Issue #5472 - CRITICAL while using Move tool with arrow keys

In gimp_edit_selection_tool_translate(), perform the active-item
checks even when the effective translation offset is 0, and only
bail afterwards.  This avoids erroneously calling
gimp_tool_message_literal() with a NULL message in this case.

(cherry picked from commit 3a462a5e63)
This commit is contained in:
Ell
2020-07-29 20:04:19 +03:00
parent 0bf0f31a5b
commit 22690abac3

View File

@ -1084,8 +1084,6 @@ gimp_edit_selection_tool_translate (GimpTool *tool,
0);
if (inc_x != 0 || inc_y != 0)
{
switch (translate_type)
{
case GIMP_TRANSFORM_TYPE_SELECTION:
@ -1184,7 +1182,6 @@ gimp_edit_selection_tool_translate (GimpTool *tool,
case GIMP_TRANSFORM_TYPE_IMAGE:
g_return_val_if_reached (FALSE);
}
}
if (! item)
{
@ -1200,6 +1197,9 @@ gimp_edit_selection_tool_translate (GimpTool *tool,
return TRUE;
}
if (inc_x == 0 && inc_y == 0)
return TRUE;
switch (edit_mode)
{
case GIMP_TRANSLATE_MODE_FLOATING_SEL: