diff options
author | László Németh <nemeth@numbertext.org> | 2024-06-08 23:39:13 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2024-06-10 23:22:20 +0200 |
commit | b285cf49dffe8a74f0ba54b88b781db6a68a4f3b (patch) | |
tree | 876739c8dde8e64505dfa50bc2fd44af23360f65 /sw/source/uibase/docvw | |
parent | 4cd4be3e7cc77953813a6f1713b6b8245ca92214 (diff) |
tdf#157833 tdf#155692 sw: fix hit area to resize row/col
Fix 1) missing or too narrow hit area (tdf#157833),
and 2) not recognized click inside hit area (tdf#155692).
It was impossible or very hard to resize text table
columns and rows using the mouse:
1) Double arrow, i.e. "resize row/col" mouse pointer shows
the hit area of text table row/column borders. This was
missing or was very narrow with normal zoom, because of an
obsolete constant for low resolution displays.
Change this constant used in IsSame() with scale-dependent
values to support the same hit area on different zoom levels
and with different screen resolutions.
2) Especially on bigger zoom, "resize row/col" mouse pointer,
i. e. the visible hit area didn't guarantee drag & drop any
more because of too small hit area in pixels in the svruler
code base: clicking on not exactly center of the hit area
resulted selection of cells or the cell content instead of
drag & drop the border, violating WYSIWYG. Enlarge the default
1 pixel to 5 pixels to cover the whole hit area. Note:
only for resizing table borders inside the document, not on
the horizontal and vertical rulers.
Change-Id: I398a0de782040b0ad18835658ed625117a6e0e06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168605
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r-- | sw/source/uibase/docvw/edtwin3.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sw/source/uibase/docvw/edtwin3.cxx b/sw/source/uibase/docvw/edtwin3.cxx index 2b9d1a7f1e03..423b6a53847e 100644 --- a/sw/source/uibase/docvw/edtwin3.cxx +++ b/sw/source/uibase/docvw/edtwin3.cxx @@ -84,10 +84,14 @@ void FrameNotify( SwViewShell* pVwSh, FlyMode eMode ) // Notify for page number update bool SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, bool bVerticalMode) { + // Especially on bigger zoom, changed mouse pointer didn't guarantee + // drag & drop any more because of too small hit area in pixel. + // Enlarge it 5 pixels to cover the whole hit area. + tools::Long nTol = 5L; SvxRuler& rRuler = bVerticalMode ? m_rView.GetVRuler() : m_rView.GetHRuler(); - return (!rRuler.StartDocDrag( rMEvt, RulerType::Border ) && - !rRuler.StartDocDrag( rMEvt, RulerType::Margin1) && - !rRuler.StartDocDrag( rMEvt, RulerType::Margin2)); + return (!rRuler.StartDocDrag( rMEvt, RulerType::Border, nTol ) && + !rRuler.StartDocDrag( rMEvt, RulerType::Margin1, nTol ) && + !rRuler.StartDocDrag( rMEvt, RulerType::Margin2, nTol )); } // #i23726# |