diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2022-01-10 13:08:47 +0100 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2022-01-17 08:45:52 +0100 |
commit | c32994e22ff291b0227ed74de6d0d050cf0901c8 (patch) | |
tree | 3956a266dd1c40f86ea5cf078a9e48adef4c50d7 /sc | |
parent | 5b07acbf3345918f450fccf7ee243ad5bcb3fd67 (diff) |
Resolves tdf#143733 - Make selection border wider
Border width and handle size follow the zoom factor now
Border is drawn evenly inside and outside the rectangle
Change-Id: I83cfb8a8156e2f0346ded3e2abed4386d4006d00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128222
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 543a60abb673..2404ea47dd29 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6475,9 +6475,15 @@ void ScGridWindow::UpdateCursorOverlay() std::vector< basegfx::B2DRange > aRanges; const basegfx::B2DHomMatrix aTransform(GetOutDev()->GetInverseViewTransformation()); + // tdf#143733, tdf#145080 - improve border visibility + // constants picked for maximum consistency at 100% and adequate response on zoom + // line width = 1.5 at 100% (0.75 left +/- 0.75 right), 50% = 1, 200% = 1.25, 400% = 2.25 + const double MinSize = 0.25 * GetDPIScaleFactor(); + double fZoom(mrViewData.GetZoomX() * 0.5); for(const tools::Rectangle & rRA : aPixelRects) { - basegfx::B2DRange aRB(rRA.Left(), rRA.Top(), rRA.Right() + 1, rRA.Bottom() + 1); + basegfx::B2DRange aRB(rRA.Left() - MinSize - fZoom, rRA.Top() - MinSize - fZoom, + rRA.Right() + MinSize + fZoom, rRA.Bottom() + MinSize + fZoom); aRB.transform(aTransform); aRanges.push_back(aRB); } @@ -6632,9 +6638,13 @@ void ScGridWindow::UpdateAutoFillOverlay() ScDocument& rDoc = mrViewData.GetDocument(); bool bLayoutRTL = rDoc.IsLayoutRTL( nTab ); - float fScaleFactor = GetDPIScaleFactor(); + // tdf#143733 tdf#145080 - improve border visibility + // constants picked for maximum consistency at 100% + // size = 6 at 100% (as before), 50% = 4.5, 200% = 9, 400% = 15 + const float fScaleFactor = 3 * GetDPIScaleFactor(); + const double fZoom(3 * mrViewData.GetZoomX()); // Size should be even - Size aFillHandleSize(6 * fScaleFactor, 6 * fScaleFactor); + Size aFillHandleSize(fZoom + fScaleFactor, fZoom + fScaleFactor); Point aFillPos = mrViewData.GetScrPos( nX, nY, eWhich, true ); tools::Long nSizeXPix; |