Snapping to grid with tools is bugged for certain custom zoom levels with a grid size of 32x32 pixels
Environment/Versions
- GIMP version:
- Package:
Latest installer (v2.10.28) from gimp.org
- Operating System:
Windows 10 Pro x64
Description of the bug
When a grid size of 32x32 pixels is set, the zoom level is set to any percentage between 550% and 650%, 'Show grid' and 'Snap to grid' are enabled,'Snapping distance' is set to 90, 96, or 100 (depending on zoom level), and the tool used is set to a size of 32x32 pixels, then using the tool snaps to points where 4 grid lines intersect, rather than inside the grid lines. Any lower 'Snapping distance' settings partially snap to a grid line, and also do not snap at all in certain positions.
Screenshot:
Reproduction
Is the bug reproducible?
Always
Reproduction steps:
- Have the default zoom level set to 600%, have default grid set to 32x32 pixels, have snap to grid turned on, have grid shown, and have 'Snapping distance' set to 96.
- Create a pure white image with a width of at least 96 pixels (and have it be a multiple of 32 pixels), and a height of at least 48 pixels (and have it be a multiple of 32 pixels).
- Change to a square brush with a size of 32x32 pixels, or copy a 32x32 pixel region, then choose Pencil and make it use the Clipboard brush.
- Hover over an area near the center, but not exactly at the center, of a grid square.
…
Expected result:
Tool snaps to the exact center of the grid square.
Actual result:
Tool snaps to the exact center of the nearest intersection point of two grid lines.
Additional information
If you have a backtrace for a crash or a warning, paste it here.
Not applicable.