diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-03-10 21:29:25 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-03-11 00:14:22 +0100 |
commit | cbfe46bf79ac89f7cd1916eeaaf5f10164038535 (patch) | |
tree | 21ba78b6a9a296516a1ca965efc87054bafd7733 /vcl/source/gdi/FileDefinitionWidgetDraw.cxx | |
parent | 100ea3038b033b6b168860e203e893ae8f67b9c1 (diff) |
widget theme: take into account scaling factor for images
Change-Id: I65bd71dfd113fae33aee7c2b60b945e065314f80
Reviewed-on: https://gerrit.libreoffice.org/69016
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/gdi/FileDefinitionWidgetDraw.cxx')
-rw-r--r-- | vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx index b51d98b2c073..5c0920bca4d6 100644 --- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx +++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx @@ -27,6 +27,7 @@ #include <comphelper/seqstream.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/lok.hxx> #include <com/sun/star/graphic/SvgTools.hpp> #include <basegfx/DrawCommands.hxx> @@ -336,13 +337,18 @@ void munchDrawCommands(std::vector<std::shared_ptr<DrawCommand>> const& rDrawCom break; case DrawCommandType::IMAGE: { + double nScaleFactor = 1.0; + if (comphelper::LibreOfficeKit::isActive()) + nScaleFactor = comphelper::LibreOfficeKit::getDPIScale(); + auto const& rDrawCommand = static_cast<ImageDrawCommand const&>(*pDrawCommand); SvFileStream aFileStream(rDrawCommand.msSource, StreamMode::READ); BitmapEx aBitmap; - vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, 1.0); + vcl::bitmap::loadFromSvg(aFileStream, "", aBitmap, nScaleFactor); long nImageWidth = aBitmap.GetSizePixel().Width(); long nImageHeight = aBitmap.GetSizePixel().Height(); - SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth, nImageHeight); + SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth / nScaleFactor, + nImageHeight / nScaleFactor); if (!!aBitmap) { const std::shared_ptr<SalBitmap> pSalBitmap |