GNOME Bugzilla – Bug 565046
Point snapping to guides does not work outside the canvas
Last modified: 2018-05-24 12:28:59 UTC
Please describe the problem: Snapping point-like objects (which use gimp_image_snap_point) to guides and to the grid doesn't work outside the canvas, although this might be actually desirable sometimes. Steps to reproduce: 1. Create a new image with a guide. 2. Create a path. 3. Drag one of the path's nodes outside the canvas and try to position it exactly on the guide. Actual results: The node doesn't snap to the guide. Expected results: The node snaps to the guide. Does this happen every time? Happens every time. Other information: I first thought this was the same as bug #169892, but that one seemed to have been partly fixed already.
Created attachment 124978 [details] [review] Patch to remove all image boundary checks Patch implementing the proposed behaviour, tested with svn r27811. Note that snapping to grid still does not work as expected outside the canvas with this patch.
How does it not work? Does that mean that this change should not be applied?
Created attachment 125762 [details] [review] Patch to enable snapping outside the canvas and to fix odd behaviour there. Snapping to the grid only worked in one dimension when horizontally (x)or vertically outside the image and not at all when diagonally outside. In this respect the previous patch was not ready to be applied yet. This patch should take care of that problem as well. Additionally it removes some very ugly code.
Even though one could argue that we should not snap to the grid outside the canvas as it is also not visible outside the canvas, I tend to agree that this patch should be applied. Any objections anyone?
After giving it some more thoughts, I have to object myself. The grid does not exist outside the image, so there should also not be any snapping to the grid. This is somewhat different for guides as we changed them to be drawn outside the canvas as well. At that point we also had to change the snapping code to snap to guides outside the canvas. So if we wanted to enable grid snapping outside the canvas, we would also have to draw the grid there. I suggest that we close this as NOTABUG.
I think we should open a new bug report for making the grid be drawn outside the canvas and make this bug report depend on that one.
I'm with Martin, draw the grid outside the canvas and then add snapping.
I'm with Martin as well, but still the original issue of this bug (snapping to guides outside the canvas) remains. And I disagree that the grid does not exist outside th canvas, it's simply not drawn there (just as the content of layers is not drawn). The grid (as currently implemented) gets is existence from its effects not from some grid object, I think.
Before we can snap to the area outside the canvas, we need to draw a grid there. The user needs to be able to see where things will snap. The patch itself looks fine to me.
Created attachment 150930 [details] [review] A more complete patch which corrects snap, adds guides and grid outside the canvas This collection of patches makes the following changes: - Guides can be created outside the canvas - Fixed snapping outside the canvas (same as the previous Daniel Hornung's patch) - Fixed snapping to guides having negative coordinates - The Grid is now drawn also in the area outside the canvas - Fixed drawing artifacts occurring on guides and grid when drawn outside the canvas, while panning the image view
Review of attachment 150930 [details] [review]: The patch does not apply cleanly on git master any longer, sorry for letting it bitrot. Can you upload a new version please?
Putting off milestone until we get a new patch.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/288.