summaryrefslogtreecommitdiff
path: root/vcl/headless/svpvd.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-10-23 17:20:38 +0200
committerJan Holesovsky <kendy@collabora.com>2018-11-08 14:38:27 +0100
commit498dceb43f870bf9e380f1f87e99c6ccadf1963c (patch)
tree1cfcb65dfc6b28c06bb4b4666a20218f74462585 /vcl/headless/svpvd.cxx
parentd2c7b86be879fe33ce170727421a19370ba8884d (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 'vcl/headless/svpvd.cxx')
-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,