GNOME Bugzilla – Bug 588512
Grid Spacing errors depending on unit
Last modified: 2014-05-21 19:09:34 UTC
When setting up a grid, and changing the unit type to millimeters, the grid will change back and forth depending on which box the cursor is in. An example: cursor in 'Width' pixel box: Width: 16px, 4.15mm Height: 16px, 4.23mm cursor in 'Height' unit box: Width: 16px, 4.15mm Height: 16px, 4.24mm As you can see, the height in millimeters is rounded up here. In any case, the entire grid behaves oddly there. In an 8x8 grid i have had a few 9x8 grids show up. There is a screenshot of such a case here: http://www.dotright.net/gimp-grid.png Let me know if more information is needed, or the explanation is not clear enough.
The grid is always set up in pixels internally. If you enter the spacing in millimeters it is converted to pixels. Of course there can be rounding issues when doing that. The incorrectly drawn grid lines that you show in your screen-shot looks like a bug though.
I can see how specifying the grid in millimeters could cause rounding problems. However, I have only been adjusting the pixel value. I did however tab down to close the window the first time I experienced this, and that is what caused the millimeter value to be rounded. I have uploaded another image illustrating this. Note that I have not changed any value manually, just tabbed into the field. http://www.dotright.net/gimp-grid2.png. Hope this clears it up a bit.
Confirming for 2.6.6. It's a disüplay problem, any action I'm doing in the image window will cause the grid to redraw correctly.
Let's keep this focused on the display problem then. The rounding problem is a different issue and probably not worth keeping a bug report for.
Created attachment 160700 [details] Turn on grid-view and check the painted cell. It is 32x33 when it should be only 32 in height.
Created attachment 160701 [details] How the bad-grid.xcf attached image looks on my PC
Something does seem to be wrong with the grid spacing. I am adding an XCF file which is set to have a grid with 32x32. On my screen there is one cell (the one I've painted) which is 32x33. I'm also adding a screen shot in case the XCF file looks correct on the computer of the developers. My setup: Windows Vista, 64 bit. Gimp 2.6.7. The image is 128x512 and the grid is configured to be 32x32 with offset 0,0 Cheers, Rene Jensen
*** Bug 627348 has been marked as a duplicate of this bug. ***
I suggest possibles fixes : 1) Custom unit value being used only if actually changed, so that simply tabbing through the field won't apply any change. 2) Using much more digits in custom unit display, enough so that rounding errors won't happen. (the unit detail dialog does use 6 digits) In any case, the pixel fields should allow for decimals since this is technically possible, more accurate, and does happens internally when using custom unit.
*** Bug 663468 has been marked as a duplicate of this bug. ***
*** Bug 699738 has been marked as a duplicate of this bug. ***
commit 247267031eb8915641490d1385a74df42e794557 Author: Michael Natterer <mitch@gimp.org> Date: Wed May 21 20:43:05 2014 +0200 Bug 588512 - Grid Spacing errors depending on unit Always round grid spacings and offsets to integer precision when using them for snapping and grid drawing. While we might *want* to have subpixel precision grids, all the UI is pretending it to be on pixel boundaries. Make that pretense an fact. (cherry picked from commit 08c6aefa2398dcd36f0c8963633715de6a6430b4) app/core/gimpimage-snap.c | 16 ++++++++++++++++ app/display/gimpcanvasgrid.c | 45 +++++++++++++++++++++++++++++---------------- 2 files changed, 45 insertions(+), 16 deletions(-)