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…
Reference in New Issue