Skip to content

The crop box is not in the center of the view #58

Open
@mafanwei

Description

@mafanwei

When I fix view's width or height:
<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="200dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
The Image is:
image
When I use this:
<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="300dp" android:layout_height="200dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
The Image is:
image
Only Use this:
<com.naver.android.helloyako.imagecrop.view.ImageCropView xmlns:imagecrop="http://schemas.android.com/apk/res-auto" android:layout_width="0dp" android:layout_height="0dp" imagecrop:layout_constraintBottom_toTopOf="@id/cl_title" imagecrop:layout_constraintLeft_toLeftOf="parent" imagecrop:layout_constraintRight_toRightOf="parent" imagecrop:layout_constraintTop_toTopOf="parent" android:id="@+id/cropIV" imagecrop:outsideLayerColor="#99000000" imagecrop:setInnerGridMode="on" imagecrop:gridInnerStroke="1dp" imagecrop:gridInnerColor="#FFFFB246" imagecrop:setOuterGridMode="on" imagecrop:gridOuterStroke="1dp" imagecrop:gridOuterColor="#FFFFB246" />
It's fine:
image

It's seem to something wrong in onMeasure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions