From 685c82ba64ab301da5690f1c1c2e44e35fd28080 Mon Sep 17 00:00:00 2001 From: Vardan Petrosyan Date: Mon, 5 Feb 2024 16:21:31 +0400 Subject: [PATCH] Fix return value of undo() and redo() methods. --- .../main/java/ja/burhanrashid52/photoeditor/GraphicManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/photoeditor/src/main/java/ja/burhanrashid52/photoeditor/GraphicManager.kt b/photoeditor/src/main/java/ja/burhanrashid52/photoeditor/GraphicManager.kt index 8339788a..5ef0ab23 100644 --- a/photoeditor/src/main/java/ja/burhanrashid52/photoeditor/GraphicManager.kt +++ b/photoeditor/src/main/java/ja/burhanrashid52/photoeditor/GraphicManager.kt @@ -53,7 +53,7 @@ internal class GraphicManager( mViewState.addedViewsCount - 1 ) if (removeView is DrawingView) { - return removeView.undo() + return removeView.undo() || (mViewState.addedViewsCount != 0) } else { mViewState.removeAddedView(mViewState.addedViewsCount - 1) mPhotoEditorView.removeView(removeView) @@ -75,7 +75,7 @@ internal class GraphicManager( mViewState.redoViewsCount - 1 ) if (redoView is DrawingView) { - return redoView.redo() + return redoView.redo() && (mViewState.redoViewsCount != 0) } else { mViewState.popRedoView() mPhotoEditorView.addView(redoView)