[gimp/gimp-2-10] app: freeze drawable preview in transform tools



commit c4a621d1dc38c9d891f4fc115eb233728b251f65
Author: Ell <ell_se yahoo com>
Date:   Thu Jan 16 00:14:15 2020 +0200

    app: freeze drawable preview in transform tools
    
    In GimpTransformGridTool, when transforming a drawable, freeze the
    drawable's preview while the tool is active, so that its ancestors'
    previews don't get unnecessarily updated in response to hiding it.

 app/tools/gimptransformgridtool.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/app/tools/gimptransformgridtool.c b/app/tools/gimptransformgridtool.c
index e4d9c9a9ca..aa5ee10f00 100644
--- a/app/tools/gimptransformgridtool.c
+++ b/app/tools/gimptransformgridtool.c
@@ -37,6 +37,7 @@
 #include "core/gimppickable.h"
 #include "core/gimpprojection.h"
 #include "core/gimptoolinfo.h"
+#include "core/gimpviewable.h"
 
 #include "vectors/gimpvectors.h"
 #include "vectors/gimpstroke.h"
@@ -290,6 +291,9 @@ gimp_transform_grid_tool_initialize (GimpTool     *tool,
 
   tr_tool->object = object;
 
+  if (GIMP_IS_DRAWABLE (object))
+    gimp_viewable_preview_freeze (GIMP_VIEWABLE (object));
+
   /*  Initialize the transform_grid tool dialog  */
   if (! tg_tool->gui)
     gimp_transform_grid_tool_dialog (tg_tool);
@@ -1086,7 +1090,13 @@ gimp_transform_grid_tool_halt (GimpTransformGridTool *tg_tool)
   tool->display   = NULL;
   tool->drawable  = NULL;
 
-  tr_tool->object = NULL;
+  if (tr_tool->object)
+    {
+      if (GIMP_IS_DRAWABLE (tr_tool->object))
+        gimp_viewable_preview_thaw (GIMP_VIEWABLE (tr_tool->object));
+
+      tr_tool->object = NULL;
+    }
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]