mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-04 02:37:30 +01:00
make sure Redo is invisible if theres nothing to redo
This commit is contained in:
parent
8386dd4286
commit
d2b219201a
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user