Skip to content

Commit f57e842

Browse files
update CropFrameEditDialog
1 parent 32713f6 commit f57e842

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

app/src/main/java/com/smarttoolfactory/composecropper/preferences/frames/edit/CropFrameEditDialog.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ fun CropFrameEditDialog(
8181
outline = it
8282
}
8383
}
84+
OutlineType.ImageMask -> {
85+
val imageMaskOutline = outline as ImageMaskOutline
86+
ImageMaskEdit(imageMaskOutline) {
87+
outline = it
88+
}
89+
}
90+
OutlineType.Custom -> {
91+
val customPathOutline = outline as CustomPathOutline
92+
CustomPathEdit(
93+
aspectRatio = aspectRatio,
94+
dstBitmap = dstBitmap,
95+
customPathOutline = customPathOutline,
96+
) {
97+
outline = it
98+
}
99+
}
84100
else -> Unit
85101
}
86102
},

cropper/src/main/java/com/smarttoolfactory/cropper/model/CropFrame.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data class CropFrame(
2424
get() = cropOutlineContainer.size
2525

2626
fun addOutline(outline: CropOutline): CropFrame {
27-
27+
outlines.toMutableList().add(outline)
2828
return this
2929
}
3030
}
@@ -64,9 +64,9 @@ fun getOutlineContainer(
6464
}
6565

6666
OutlineType.Custom -> {
67-
PolygonOutlineContainer(
67+
CustomOutlineContainer(
6868
selectedIndex = index,
69-
outlines = outlines as List<PolygonCropShape>
69+
outlines = outlines as List<CustomPathOutline>
7070
)
7171
}
7272

0 commit comments

Comments
 (0)