diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-02-22 17:42:03 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-02-23 23:50:10 +0900 |
commit | b01bcbda617b9e53e1ba9b0d3e9808cc6930c6f0 (patch) | |
tree | 614776f370b665693ef9138ac77f0d7241199fac /sc | |
parent | 43bfb0e4a693962dae2320a1d7c8825880bcb769 (diff) |
cell cursor - reduce the size, HiDPI support
Change-Id: I24cd38f0f7e0f595815548a53824452d50ddd893
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 82ebf722a734..b65c209c1069 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5797,19 +5797,39 @@ void ScGridWindow::UpdateCursorOverlay() long nSizeYPix; pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix ); - if ( bLayoutRTL ) + if (bLayoutRTL) aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring - // Now, draw the cursor. + Rectangle aRect( aScrPos, Size( nSizeXPix - 1, nSizeYPix - 1) ); + + sal_Int32 nScale = GetDPIScaleFactor(); + + long aCursorWidth = 1 * nScale; + + Rectangle aLeft = Rectangle(aRect); + aLeft.Top() -= aCursorWidth; + aLeft.Bottom() += aCursorWidth; + aLeft.Right() = aLeft.Left(); + aLeft.Left() -= aCursorWidth; + + Rectangle aRight = Rectangle(aRect); + aRight.Top() -= aCursorWidth; + aRight.Bottom() += aCursorWidth; + aRight.Left() = aRight.Right(); + aRight.Right() += aCursorWidth; + + Rectangle aTop = Rectangle(aRect); + aTop.Bottom() = aTop.Top(); + aTop.Top() -= aCursorWidth; - aScrPos.X() -= 2; - aScrPos.Y() -= 2; - Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) ); + Rectangle aBottom = Rectangle(aRect); + aBottom.Top() = aBottom.Bottom(); + aBottom.Bottom() += aCursorWidth; - aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() )); - aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() )); - aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 )); - aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() )); + aPixelRects.push_back(aLeft); + aPixelRects.push_back(aRight); + aPixelRects.push_back(aTop); + aPixelRects.push_back(aBottom); } } |