summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-02-22 15:08:46 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-02-23 23:50:10 +0900
commit43bfb0e4a693962dae2320a1d7c8825880bcb769 (patch)
tree68103240429fbfe48544a4505c1e9332e7101d66 /sc
parentabc3163756f99196ccfb5e69ad5afe070e213c54 (diff)
auto fill handle: HiDPI, increase hit area, adjust draw position
Change-Id: I197ca370dad5cadcddd2472ed9f25d7b3acc504a
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index fcbed3d952e0..82ebf722a734 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5948,18 +5948,30 @@ void ScGridWindow::UpdateAutoFillOverlay()
ScDocument* pDoc = pViewData->GetDocument();
bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
+ sal_Int32 nScale = GetDPIScaleFactor();
+ // Size should be even
+ Size aFillHandleSize = Size(6 * nScale, 6 * nScale);
+
Point aFillPos = pViewData->GetScrPos( nX, nY, eWhich, true );
long nSizeXPix;
long nSizeYPix;
pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
- if ( bLayoutRTL )
- aFillPos.X() -= nSizeXPix + 3;
+
+ if (bLayoutRTL)
+ aFillPos.X() -= nSizeXPix - 2 + (aFillHandleSize.Width() / 2);
else
- aFillPos.X() += nSizeXPix - 2;
+ aFillPos.X() += nSizeXPix - (aFillHandleSize.Width() / 2);
aFillPos.Y() += nSizeYPix;
- aFillPos.Y() -= 2;
- mpAutoFillRect.reset(new Rectangle(aFillPos, Size(6, 6)));
+ aFillPos.Y() -= (aFillHandleSize.Height() / 2);
+
+ Rectangle aFillRect(aFillPos, aFillHandleSize);
+
+ // expand rect to increase hit area
+ mpAutoFillRect.reset(new Rectangle(aFillRect.Left() - nScale,
+ aFillRect.Top() - nScale,
+ aFillRect.Right() + nScale,
+ aFillRect.Bottom() + nScale));
// #i70788# get the OverlayManager safely
rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager = getOverlayManager();
@@ -5972,7 +5984,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
aHandleColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
std::vector< basegfx::B2DRange > aRanges;
const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
- basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1);
+ basegfx::B2DRange aRB(aFillRect.Left(), aFillRect.Top(), aFillRect.Right(), aFillRect.Bottom());
aRB.transform(aTransform);
aRanges.push_back(aRB);