mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-17 12:10:47 +01:00
Increase flood-fill tolerance
This breaks color filling in complex images with no clear boundaries
This commit is contained in:
parent
294609c643
commit
944848a159
@ -32,6 +32,8 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
||||
private val MIN_ERASER_WIDTH = 20f
|
||||
private val MAX_HISTORY_COUNT = 1000
|
||||
private val BITMAP_MAX_HISTORY_COUNT = 60
|
||||
private val DEFAULT_FLOOD_FILL_TOLERANCE = 160
|
||||
|
||||
private val mScaledTouchSlop = ViewConfiguration.get(context).scaledTouchSlop
|
||||
|
||||
private var mOperations = ArrayList<CanvasOp>()
|
||||
@ -395,7 +397,7 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
||||
val color = mPaintOptions.color
|
||||
|
||||
ensureBackgroundThread {
|
||||
val img = bitmap.floodFill(color = color, x = touchedX, y = touchedY)
|
||||
val img = bitmap.floodFill(color = color, x = touchedX, y = touchedY, tolerance = DEFAULT_FLOOD_FILL_TOLERANCE)
|
||||
addOperation(CanvasOp.BitmapOp(img))
|
||||
post { invalidate() }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user