Bug 143685 - Dragging a table border, there should be a snap to other borders
Summary: Dragging a table border, there should be a snap to other borders
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: Table-Borders
  Show dependency treegraph
Reported: 2021-08-02 08:06 UTC by Mike Kaganski
Modified: 2021-08-17 07:35 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

A screencast of misaligned border after drag (277.85 KB, image/gif)
2021-08-02 08:06 UTC, Mike Kaganski

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2021-08-02 08:06:40 UTC
Created attachment 174022 [details]
A screencast of misaligned border after drag

When resizing Writer table cells using mouse, there is no snapping of dragged borders to the existing borders in the rows above/below. That makes it impossible to make a perfect alignment of the dragged border to existing borders in other rows, unless one later does a following drag of the almost-aligned border within a built-in allowance (20 twip = 0.35 mm), which would align all the almost-aligned borders, *but* would also resize the column - which is not always desirable.

Steps to reproduce:

1. Create a 3-column 2-row table.
2. Select A2:B2, and merge the cells.
3. In A2, split the cell vertically to 3 cells.
4. Zoom in to maximum to see the details.
5. Use mouse to drag a vertical border in row 2 to match a border of row 1.

See that usually the end result is not perfect; even though the following drag would treat those almost-aligned borders as one, it is still not perfect.

It will be usually even less perfect when not zooming in to the maximum. Users complain that they do not see when the border "snapped" to the adjacent borders' position [1] (which in fact does not happen at all, which is why they do not see it).

The proposal is to add the positions of existing borders in adjacent rows/columns to the snap positions of the drag operation. That would both create a useful visual feedback to users, and also allow for a perfect alignment when the snap occurs. It may be dynamically disabled e.g. when pressing a modifier key like Alt.

[1] https://forumooo.ru/index.php/topic,8735 (Russian)
Comment 1 Mike Kaganski 2021-08-02 12:37:10 UTC
The possible code pointer is at SvxRuler::DragBorders, which calls SvxRuler::MakePositionSticky.
Comment 2 Dieter 2021-08-17 07:16:31 UTC
I confirm it with

Version: (x64) / LibreOffice Community
Build ID: 2a7ea282da28d665a7dc086360567b4aea27bf08
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

I would say it's a bug and not enhancement. so I set status to NEW, but of course Design Team can decide something different
Comment 3 Heiko Tietze 2021-08-17 07:35:36 UTC
Feature is to drag the table border with the enhancement request to also snap it. Very welcome addition. We should not miss a way to disable the snapping, eg. when Alt is being pressed. When cells are exactly positioned, eg. in a column, changing the size of a single cell is cumbersome (requires split, size, merge).