Skip to content

Commit 32713f6

Browse files
add sample image masks to CropFrameFactory
1 parent a2bb0f3 commit 32713f6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cropper/src/main/java/com/smarttoolfactory/cropper/settings/CropFrameFactory.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import androidx.compose.ui.graphics.ImageBitmap
55
import com.smarttoolfactory.cropper.model.*
66
import com.smarttoolfactory.cropper.util.createPolygonShape
77

8-
class CropFrameFactory(private val defaultImage: ImageBitmap) {
8+
class CropFrameFactory(private val defaultImages: List<ImageBitmap>) {
99

1010
private val cropFrames = mutableStateListOf<CropFrame>()
1111

@@ -153,10 +153,13 @@ class CropFrameFactory(private val defaultImage: ImageBitmap) {
153153
}
154154

155155
OutlineType.ImageMask -> {
156+
157+
val outlines = defaultImages.mapIndexed { index, image ->
158+
ImageMaskOutline(id = index, title = "ImageMask", image = image)
159+
160+
}
156161
ImageMaskOutlineContainer(
157-
outlines = listOf(
158-
ImageMaskOutline(id = 0, title = "ImageMask", image = defaultImage)
159-
)
162+
outlines = outlines
160163
)
161164
}
162165
}

0 commit comments

Comments
 (0)