diff options
author | Jan Holesovsky <kendy@collabora.com> | 2018-10-23 17:20:38 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-11-07 12:51:03 +0100 |
commit | 053d9247ce0818580658a7b6f5854f8b21754f7c (patch) | |
tree | 74e8357d14920b7babe85b9287dff8e52e5bbefd /comphelper | |
parent | ddd2790f3402abaa64ccc501b63826dd29b29b68 (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
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 05a991dad074..0d496df6ccba 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -35,6 +35,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; @@ -75,6 +78,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; |