mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-06-05 21:59:17 +02:00
make sure Redo is invisible if theres nothing to redo
This commit is contained in:
@ -84,6 +84,11 @@ class MyCanvas(context: Context, attrs: AttributeSet) : View(context, attrs) {
|
||||
}
|
||||
|
||||
fun redo() {
|
||||
if (mUndonePaths.keys.isEmpty()) {
|
||||
mListener?.toggleRedoVisibility(false)
|
||||
return
|
||||
}
|
||||
|
||||
val lastKey = mUndonePaths.keys.last()
|
||||
addPath(lastKey, mUndonePaths.values.last())
|
||||
mUndonePaths.remove(lastKey)
|
||||
|
Reference in New Issue
Block a user