diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/MyCanvas.kt b/app/src/main/kotlin/com/simplemobiletools/draw/MyCanvas.kt index 5dcb4df..8baf930 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/MyCanvas.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/MyCanvas.kt @@ -17,6 +17,8 @@ import java.util.* import java.util.concurrent.ExecutionException class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) { + private val MIN_ERASER_WIDTH = 20f + var mPaths = LinkedHashMap() var mBackgroundBitmap: Bitmap? = null private var mPaint = Paint() @@ -178,6 +180,9 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) { mPaint.color = paintOptions.color mPaint.strokeWidth = paintOptions.strokeWidth + if (paintOptions.isEraser && mPaint.strokeWidth < MIN_ERASER_WIDTH) { + mPaint.strokeWidth = MIN_ERASER_WIDTH + } } fun clearCanvas() {