From be67fab68eb974e78686f8f9a2583af27d1119d4 Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Sat, 27 Oct 2018 17:25:06 +0000 Subject: lok: sc: make hi-dpi/zoom compatible with retrieving cell cursor A bit different approach than trying to handle different zoom levels at the samet time: instead, always handle the spreadsheet at 100%, but use cairo to scale to the actual zoom level. Change-Id: I318aec8fa4baaab2ee1f271223b2e10e26d41fcf (cherry picked from commit 201045f9c47d219a2aa3a6571a48a92e6ac6569e) --- sc/source/ui/view/gridwin.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 400b2ee959a7..5bce39050830 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5631,7 +5631,7 @@ OString ScGridWindow::getCellCursor( int nOutputWidth, int nOutputHeight, return getCellCursor(zoomX, zoomY); } -OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoomY) const +OString ScGridWindow::getCellCursor(const Fraction& /*rZoomX*/, const Fraction& /*rZoomY*/) const { // GridWindow stores a shown cell cursor in mpOOCursors, hence // we can use that to determine whether we would want to be showing @@ -5647,7 +5647,10 @@ OString ScGridWindow::getCellCursor(const Fraction& rZoomX, const Fraction& rZoo Fraction defaultZoomX = pViewData->GetZoomX(); Fraction defaultZoomY = pViewData->GetZoomY(); - pViewData->SetZoom(rZoomX, rZoomY, true); + // hardcode to what we mean as 100% (256px tiles meaning 3840 twips) + Fraction aFracX(long(256 * TWIPS_PER_PIXEL), 3840); + Fraction aFracY(long(256 * TWIPS_PER_PIXEL), 3840); + pViewData->SetZoom(aFracX, aFracY, true); Point aScrPos = pViewData->GetScrPos( nX, nY, eWhich, true ); long nSizeXPix; -- cgit v1.2.3