After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 398183 - CTRL modifier on a selection does not snap the starting corner back...
CTRL modifier on a selection does not snap the starting corner back...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other All
: Normal minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2007-01-18 23:22 UTC by jbaker
Modified: 2007-06-29 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Intelligent-Rectangle-Ctrl-Behvaiour.patch (8.85 KB, patch)
2007-06-23 19:06 UTC, Martin Nordholts
needs-work Details | Review
Intelligent-Rectangle-Ctrl-Behvaiour-complete.patch (10.18 KB, patch)
2007-06-24 08:29 UTC, Martin Nordholts
none Details | Review
Intelligent-Rectangle-Ctrl-Behvaiour-final-draft-1.patch (8.95 KB, patch)
2007-06-27 20:25 UTC, Martin Nordholts
committed Details | Review

Description jbaker 2007-01-18 23:22:02 UTC
Please describe the problem:
If you start to drag a selection, then press CTRL to switch to a centered selection, then release CTRL again, It does not snap the corner back to the starting point. Not major, but if you meant to use shift instead, it can be annoying, and it seems more natural that it would snap back...

Steps to reproduce:
1. New Image
2. Start a new selection with the rectangle selection tool
3. Press CTRL while dragging
4. Release CTRL while dragging
 


Actual results:
The starting corner does not snap back to the original origin...

Expected results:
The starting corner does snap back to the original origin...

Does this happen every time?
Yes

Other information:
Xubuntu 6.10
Comment 1 Sven Neumann 2007-01-26 22:27:53 UTC
This is a major usability problem and need to be looked at before 2.4.
Comment 2 Martin Nordholts 2007-06-23 13:48:17 UTC
I will have a patch in some hours.
Comment 3 Martin Nordholts 2007-06-23 19:06:39 UTC
Created attachment 90528 [details] [review]
Intelligent-Rectangle-Ctrl-Behvaiour.patch

A solution based on introducing the logic of "the other side".

Works nicely imo, what needs to be done though is to elegantly *not* "reset" the rectangle when the moues is released while Ctrl is being held down (as marked by the we_dont_come_here_from_a_mouse_release "boolean").
Comment 4 Martin Nordholts 2007-06-24 08:29:20 UTC
Created attachment 90541 [details] [review]
Intelligent-Rectangle-Ctrl-Behvaiour-complete.patch

Complete patch, now keeps track of if modifier keys were released by a mouse release or not. Please review.
Comment 5 Michael Natterer 2007-06-26 14:33:56 UTC
That "mouse_was_released" boolean is not needed and moreover doesn't
catch all cases where active_modifier_key() is called to reset the
state.

Simply look at (state & GDK_BUTTON1_MASK) instad please.
Comment 6 Martin Nordholts 2007-06-27 20:25:49 UTC
Created attachment 90782 [details] [review]
Intelligent-Rectangle-Ctrl-Behvaiour-final-draft-1.patch

Uses (state & GDK_BUTTON1_MASK) instead. Also calls gimp_rectangle_tool_configure to update highlight area and handle sizes when the rectangle resets itself.
Comment 7 Michael Natterer 2007-06-28 16:27:38 UTC
The tool still doesn't react to shift and control *press* immediately,
only to control release after this patch. To see the effect of the
other options i still have to move the mouse. Can you fix that too please?
Comment 8 Martin Nordholts 2007-06-28 19:20:06 UTC
Fixing that in a clean way worth keeping for 2.4 requires extracting relevant code from gimp_rectangle_tool_motion and put it into a stand-alone function that can be called independently.

Since that is more natural to do as part of the bigger refactoring I mentioned on the mailing list and intend to do the coming weeks, I suggest I commit this patch as-is (unless you have additional feedback) and consider this particular bug solved.

I won't commit with your 'OK' first though, so let me know what you think.
Comment 9 Michael Natterer 2007-06-28 21:33:18 UTC
Looks ok, please commit, but please change the new prototypes to properly
align with the other prototypes, even if they get longer than 80 chars.
Comment 10 Martin Nordholts 2007-06-29 16:51:31 UTC
Fixed in trunk, revision 22854.

2007-06-29  Martin Nordholts  <martinn@svn.gnome.org>

	Made GimpRectangleTools remember where the "other side" is when
	fixed-center is turned on, and reset the "other side" to that
	position when fixed-center is turned off again. Fixes bug 398183.

	* app/tools/gimprectangletool.c
	(gimp_rectangle_tool_button_press): Remember "other side".
	(gimp_rectangle_tool_active_modifier_key): When fixed-center is
	turned off, reset "other side".
	(gimp_rectangle_tool_get_other_side)
	(gimp_rectangle_tool_get_other_side_coord)
	(gimp_rectangle_tool_set_other_side_coord): New functions.