summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin4.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-10-28 20:43:46 +0000
committerMichael Meeks <michael.meeks@collabora.com>2019-11-05 21:50:00 +0100
commitebad4dec8c7e7427b3dbb3536ca3899a44e09f09 (patch)
treec80fe2e14d1b7fc171602f98cf0d1f819c99008b /sc/source/ui/view/gridwin4.cxx
parent5061d541dd192062c0d014cc0a10b8722db0df2a (diff)
Revert "sc lok: Implement hi-dpi and zoom for spreadsheets."
This reverts commit 498dceb43f870bf9e380f1f87e99c6ccadf1963c. Change-Id: Iadb9da47cf8c9a57385530ab888d55169db7639a Reviewed-on: https://gerrit.libreoffice.org/82095 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/source/ui/view/gridwin4.cxx')
-rw-r--r--sc/source/ui/view/gridwin4.cxx31
1 files changed, 9 insertions, 22 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 3271139cdbb7..75111de74eae 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1113,30 +1113,17 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
// coords only, and avoid all the SetMapMode()'s.
// Similarly to Writer, we should set the mapmode once on the rDevice, and
// not care about any zoom settings.
- //
- // But until that happens, we actually draw everything at 100%, and only
- // set cairo's or CoreGraphic's scale factor accordingly, so that everything
- // is painted bigger or smaller. This is different to what Calc's internal
- // scaling would do - because that one is trying to fit the lines between
- // cells to integer multiples of pixels.
- //
- // See also desktop/source/lib/init.cxx for details, where we have to set
- // the stuff accordingly for the VirtualDevice creation.
-
- // page break zoom, and aLogicMode in ScViewData - hardcode that 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);
- // Cairo or CoreGraphics scales for us, we have to compensate for that,
- // otherwise we are painting too far away
- const double fDPIScale = comphelper::LibreOfficeKit::getDPIScale();
+ Fraction aFracX(long(nOutputWidth * TWIPS_PER_PIXEL), nTileWidth);
+ Fraction aFracY(long(nOutputHeight * TWIPS_PER_PIXEL), nTileHeight);
+
+ // page break zoom, and aLogicMode in ScViewData
+ pViewData->SetZoom(aFracX, aFracY, true);
- const double fTilePosXPixel = static_cast<double>(nTilePosX) * nOutputWidth / (nTileWidth * fDPIScale);
- const double fTilePosYPixel = static_cast<double>(nTilePosY) * nOutputHeight / (nTileHeight * fDPIScale);
- const double fTileBottomPixel = static_cast<double>(nTilePosY + nTileHeight) * nOutputHeight / (nTileHeight * fDPIScale);
- const double fTileRightPixel = static_cast<double>(nTilePosX + nTileWidth) * nOutputWidth / (nTileWidth * fDPIScale);
+ const double fTilePosXPixel = static_cast<double>(nTilePosX) * nOutputWidth / nTileWidth;
+ const double fTilePosYPixel = static_cast<double>(nTilePosY) * nOutputHeight / nTileHeight;
+ const double fTileBottomPixel = static_cast<double>(nTilePosY + nTileHeight) * nOutputHeight / nTileHeight;
+ const double fTileRightPixel = static_cast<double>(nTilePosX + nTileWidth) * nOutputWidth / nTileWidth;
SCTAB nTab = pViewData->GetTabNo();
ScDocument* pDoc = pViewData->GetDocument();