Skip to content

Commit

Permalink
PAINTROID-545 Zooming while cursor tool is down deletes the already d…
Browse files Browse the repository at this point in the history
…rawn line
  • Loading branch information
bakicelebi committed Feb 8, 2023
1 parent c82effe commit ae29828
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ open class DrawingSurfaceListener(
} else {
disableAutoScroll()
if (touchMode == TouchMode.DRAW) {
checkCursorToolBeforeReset(PointF(event.x, event.y))
currentTool?.resetInternalState(StateChange.MOVE_CANCELED)
}
touchMode = TouchMode.PINCH
Expand All @@ -166,6 +167,14 @@ open class DrawingSurfaceListener(
}
}

private fun checkCursorToolBeforeReset(point: PointF) {
val currentTool = callback.getCurrentTool()
if (currentTool?.toolType?.name.equals(ToolType.CURSOR.name)) {
currentTool?.handleUp(point)
currentTool?.handleDown(point)
}
}

override fun onTouch(view: View, event: MotionEvent): Boolean {
val drawingSurface = view as DrawingSurface
val currentTool = callback.getCurrentTool()
Expand Down

0 comments on commit ae29828

Please sign in to comment.