summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-10-23 17:20:38 +0200
committerJan Holesovsky <kendy@collabora.com>2018-11-07 12:51:03 +0100
commit053d9247ce0818580658a7b6f5854f8b21754f7c (patch)
tree74e8357d14920b7babe85b9287dff8e52e5bbefd /vcl
parentddd2790f3402abaa64ccc501b63826dd29b29b68 (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 'vcl')
-rw-r--r--vcl/headless/svpvd.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index 4172fc383744..875f22a5d7fc 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -25,6 +25,7 @@
#include <headless/svpgdi.hxx>
#include <basegfx/vector/b2ivector.hxx>
+#include <comphelper/lok.hxx>
#include <cairo.h>
@@ -90,9 +91,17 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
double fXScale, fYScale;
- cairo_surface_get_device_scale(m_pRefSurface, &fXScale, &fYScale);
- nNewDX *= fXScale;
- nNewDY *= fYScale;
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Force scaling of the painting
+ fXScale = fYScale = comphelper::LibreOfficeKit::getDPIScale();
+ }
+ else
+ {
+ cairo_surface_get_device_scale(m_pRefSurface, &fXScale, &fYScale);
+ nNewDX *= fXScale;
+ nNewDY *= fYScale;
+ }
#endif
m_pSurface = cairo_image_surface_create_for_data(pBuffer, CAIRO_FORMAT_ARGB32,