summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-03-10 21:29:25 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-08-29 20:10:54 +0900
commite51f941d7e366ad7aec912a27d00634031fee2cb (patch)
tree174585c56d7d99b33a89619ae01fb41015605708 /vcl
parent7dc27fe2191091616afe2148fb571fc12e38bd2d (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> (cherry picked from commit cbfe46bf79ac89f7cd1916eeaaf5f10164038535)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/FileDefinitionWidgetDraw.cxx10
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