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.
This commit is contained in:
Ell 2020-01-16 00:14:15 +02:00
parent 006f300fff
commit 2e26603a55
1 changed files with 11 additions and 1 deletions

View File

@ -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