Merge branch 'ExpandFromCenterIssue' into 'master'

Expand From Center fails with some modifiers (Fixes #9453)

Closes #9453

See merge request GNOME/gimp!932
This commit is contained in:
programmer_ceds 2025-07-01 03:23:56 +00:00
commit 9c00f144c7

View file

@ -1877,9 +1877,6 @@ gimp_tool_rectangle_motion_modifier (GimpToolWidget *widget,
{
GimpToolRectangle *rectangle = GIMP_TOOL_RECTANGLE (widget);
GimpToolRectanglePrivate *private = rectangle->private;
gboolean button1_down;
button1_down = (state & GDK_BUTTON1_MASK);
if (key == gimp_get_extend_selection_mask ())
{
@ -1891,10 +1888,14 @@ gimp_tool_rectangle_motion_modifier (GimpToolWidget *widget,
gimp_tool_rectangle_options_notify,
rectangle);
#endif
/* Only change the shape if the mouse is still down (i.e. the user is
* still editing the rectangle.
*/
if (private->modifier_toggle_allowed)
g_object_set (rectangle,
"fixed-rule-active", ! private->fixed_rule_active,
NULL);
{
g_object_set (rectangle,
"fixed-rule-active", ! private->fixed_rule_active,
NULL);
#if 0
g_signal_handlers_unblock_by_func (options,
@ -1902,11 +1903,6 @@ gimp_tool_rectangle_motion_modifier (GimpToolWidget *widget,
rectangle);
#endif
/* Only change the shape if the mouse is still down (i.e. the user is
* still editing the rectangle.
*/
if (button1_down)
{
if (! private->fixed_rule_active)
{
/* Reset anchor point */
@ -1923,39 +1919,26 @@ gimp_tool_rectangle_motion_modifier (GimpToolWidget *widget,
if (key == gimp_get_toggle_behavior_mask ())
{
/* Only change the shape if the mouse is still down (i.e. the user is
* still editing the rectangle.
*/
if (private->modifier_toggle_allowed)
g_object_set (rectangle,
"fixed-center", ! private->fixed_center,
NULL);
if (private->fixed_center)
{
gimp_tool_rectangle_update_with_coord (rectangle,
private->lastx,
private->lasty);
g_object_set (rectangle,
"fixed-center", ! private->fixed_center,
NULL);
/* Only emit the rectangle-changed signal if the button is
* not down. If it is down, the signal will and shall be
* emitted on _button_release instead.
*/
if (! button1_down)
{
gimp_tool_rectangle_change_complete (rectangle);
}
if (private->fixed_center)
gimp_tool_rectangle_update_with_coord (rectangle,
private->lastx,
private->lasty);
else
gimp_tool_rectangle_set_other_side_coord (rectangle,
private->other_side_x,
private->other_side_y);
}
else if (button1_down)
{
/* If we are leaving fixed_center mode we want to set the
* "other side" where it should be. Don't do anything if we
* came here by a mouse-click though, since then the user
* has confirmed the shape and we don't want to modify it
* afterwards.
*/
gimp_tool_rectangle_set_other_side_coord (rectangle,
private->other_side_x,
private->other_side_y);
}
}
}
gimp_tool_rectangle_update_options (rectangle);
}