Bug 72912

Summary: VIEWING: Snap grid and cell grid misalignment
Product: LibreOffice Reporter: lujomu
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: barta, lujomu, suokunlong
Priority: medium    
Version: 4.1.2.3 release   
Hardware: Other   
OS: Windows (All)   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=116027
Whiteboard: BSA
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 116219    
Attachments: Spreadsheet with cell height/width and horizontal/vertical grid spacing set to 0.5 cm. Scrolled to the last row/colum, where the effect is very obvious.
Screenshots showing the issue

Description lujomu 2013-12-20 12:27:05 UTC
Created attachment 91038 [details]
Spreadsheet with cell height/width and horizontal/vertical grid spacing set to 0.5 cm. Scrolled to the last row/colum, where the effect is very obvious.

Problem description:
If set to the same values, the grid (for 'snap to grid') does not match up with the cell width/height exactly.

Steps to reproduce:
1. Set the cell height and width to '0.50 cm' for all cells.
2. Make the grid visible (Options > LibreOffice Calc > Grid).
3. Set the grid horizontal and vertical grid spacing to '0.50 cm' (Options > LibreOffice Calc > Grid).

Current behavior:
The grid dots do not align with the cell lines. Especially the farther you scroll away from the first row/column.

Expected behavior:
The grid should match the cells exactly. So that if you draw a rectangle over a cell with snapping enabled, the lines of the rectangle should align with the cell.
              
Operating System: Windows 8
Version: 4.1.2.3 release
Comment 1 Dominique Boutry 2014-01-13 13:59:11 UTC
Reproduced with LibO 4.2.0.1 rc1 on Win7.

I wonder if it is a bug... I found no place in any worksheet software where the specification of the grid drawing should be mastered by the user at the pixel. Contrary to a drawing tool.
Comment 2 Kevin Suo 2014-07-19 09:00:40 UTC
In my opinion, althrough the cell height is set the same as "grid", but for cells, the cell borders also has some "height".
That's why there are 10 extra rows below the last "grid".
Comment 3 lujomu 2014-07-20 21:11:37 UTC
(In reply to comment #2)
> In my opinion, althrough the cell height is set the same as "grid", but for
> cells, the cell borders also has some "height".

That would make sense, but that would mean that the distance from one cell border to the next (cell height + border width) would have to be greater than the distance between two grid dots, which they are not. (This can easily be observed when scrolling down from the top of the sheet: In the beginning the grid dots are close to the cell borders, but as you scroll down they "move" downwards away from the cell borders. If the grid distance would be smaller than the border distance, the grid dots would "move" upwards.)

> That's why there are 10 extra rows below the last "grid".

For me the grid goes all the way to the last row/column.
Comment 4 Kevin Suo 2014-11-10 07:34:19 UTC
This bug was confirmed already, and is reproducible with version 4.3.3.2, Win 7 X86.
Set status to NEW.
Comment 5 Kevin Suo 2014-11-10 07:40:13 UTC
Created attachment 109193 [details]
Screenshots showing the issue

See screenshot, comparing the Snap Grid lines (with small dots) with the row height.
Comment 6 QA Administrators 2015-12-20 16:11:19 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2017-01-03 19:47:38 UTC Comment hidden (obsolete)
Comment 8 lujomu 2017-01-03 22:57:55 UTC
Bug is still present in v5.2.3.3 on Windows 10 Pro x64.
Comment 9 QA Administrators 2018-01-04 03:35:52 UTC Comment hidden (obsolete)
Comment 10 lujomu 2018-01-10 15:18:08 UTC
Bug is still present in v5.4.4.2 on Windows 10 Pro x64.
Comment 11 QA Administrators 2019-05-01 02:45:50 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2021-05-01 03:56:45 UTC Comment hidden (obsolete)
Comment 13 QA Administrators 2023-05-02 03:18:15 UTC Comment hidden (obsolete)
Comment 14 lujomu 2023-05-04 07:52:39 UTC
Bug is still present in v7.5.2.2 on Windows 10 Pro x64.