Bug 796071 - Clicking outside of a selection frame creates a new, ...

...zero-size selection

Make sure that clicking outside any selection halts the rectangle
select tool. This fixes ellipse select too.
This commit is contained in:
Michael Natterer 2018-05-13 22:58:03 +02:00
parent b748dea801
commit e9f2e82cff
1 changed files with 12 additions and 1 deletions

View File

@ -584,6 +584,17 @@ gimp_rectangle_select_tool_rectangle_response (GimpToolWidget *widget,
* HALTing it like calling COMMIT would do * HALTing it like calling COMMIT would do
*/ */
gimp_rectangle_select_tool_commit (rect_tool); gimp_rectangle_select_tool_commit (rect_tool);
gimp_tool_rectangle_get_public_rect (GIMP_TOOL_RECTANGLE (widget),
&x1, &y1, &x2, &y2);
if (x1 == x2 && y1 == y2)
{
/* if there still is no rectangle after the
* tool_commit(), the click was outside the selection
* and we HALT to get rid of a zero-size tool widget.
*/
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, tool->display);
}
} }
else else
{ {