changeset 111:044e3371d44b

Do store_undo() in mpSetNativeImage() when supposedly successfully loading an image, instead of out of the function.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Jul 2018 18:20:28 +0300
parents ae324b1a020f
children a0d0994e9bac
files multipaint.pde
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/multipaint.pde	Fri Jul 06 18:16:26 2018 +0300
+++ b/multipaint.pde	Fri Jul 06 18:20:28 2018 +0300
@@ -409,6 +409,8 @@
     if (data[3] != machine && !noError)
         return -2;
 
+    store_undo();
+
     g_map = data;
 
     refreshpalette();
@@ -506,7 +508,6 @@
             int err = mpSetNativeImage(fdata);
             if (err == 0)
             {
-                store_undo();
                 mpSetTitle(fh.name);
                 if (g_spare)
                     sfilename = fh.name;