From 498dceb43f870bf9e380f1f87e99c6ccadf1963c Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 23 Oct 2018 17:20:38 +0200 Subject: sc lok: Implement hi-dpi and zoom for spreadsheets. A bit different approach than trying to paint different zoom levels at the samet time, because it is terribly hard to achieve with Calc - things misalign, because Calc tries to fit the lines into the pixels etc. Instead, always paint the spreadsheet at 100%, but use cairo to scale the actual painting. Change-Id: I228a9dd41bf29862bdd188825d12e61e1c86cccc Reviewed-on: https://gerrit.libreoffice.org/63031 Tested-by: Jenkins Reviewed-by: Jan Holesovsky --- comphelper/source/misc/lok.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'comphelper') diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index 0641e01660ab..2f6a2c151370 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -37,6 +37,9 @@ static bool g_bLocalRendering(false); static LanguageTag g_aLanguageTag("en-US", true); +/// Scaling of the cairo canvas painting for hi-dpi or zooming in Calc. +static double g_fDPIScale(1.0); + void setActive(bool bActive) { g_bActive = bActive; @@ -77,6 +80,16 @@ bool isDialogPainting() return g_bDialogPainting; } +void setDPIScale(double fDPIScale) +{ + g_fDPIScale = fDPIScale; +} + +double getDPIScale() +{ + return g_fDPIScale; +} + void setTiledAnnotations(bool bTiledAnnotations) { g_bTiledAnnotations = bTiledAnnotations; -- cgit