diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-10-23 17:20:38 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-08 14:38:27 +0100 |
commit | 498dceb43f870bf9e380f1f87e99c6ccadf1963c (patch) | |
tree | 1cfcb65dfc6b28c06bb4b4666a20218f74462585 /comphelper | |
parent | d2c7b86be879fe33ce170727421a19370ba8884d (diff) |
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 <kendy@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/lok.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
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; |