File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
app/src/main/res/drawable
colorpicker/src/main/java/com/smarttoolfactory/colorpicker/widget Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -213,20 +213,13 @@ private fun ImageThumbWithColor(
213213 drawImage(
214214 image = bitmap,
215215 srcOffset = IntOffset (
216- (offset.x.toInt() - imageThumbSize / 2 ).coerceIn(
217- 0 ,
218- (canvasWidth - imageThumbSize).toInt()
219- ),
220- (offset.y.toInt() - imageThumbSize / 2 ).coerceIn(
221- 0 ,
222- (canvasHeight - imageThumbSize).toInt()
223- )
224- ),
225- srcSize = IntSize (imageThumbSize, imageThumbSize),
226- dstOffset = IntOffset (
227- x = topLeftImageThumbX,
228- y = 0
216+ (offset.x.toInt() - imageThumbSize / 4 )
217+ .coerceIn(0 , (canvasWidth - imageThumbSize).toInt()),
218+ (offset.y.toInt() - imageThumbSize / 4 )
219+ .coerceIn(0 , (canvasHeight - imageThumbSize).toInt())
229220 ),
221+ srcSize = IntSize (imageThumbSize / 2 , imageThumbSize / 2 ),
222+ dstOffset = IntOffset (x = topLeftImageThumbX, y = 0 ),
230223 dstSize = IntSize (imageThumbSize, imageThumbSize)
231224 )
232225
You can’t perform that action at this time.
0 commit comments