summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-01-06 23:34:44 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-01-07 03:13:13 +0100
commit9707a0017379317069383fd061384a91a8b46281 (patch)
treedd8ada30dece2817a680b7f5247dc543fd295724 /vcl
parent57d9503056d83605645bf0ad4d5d82a04e28ef98 (diff)
use the rect from all primitives when converting svg to Bitmap
In some cases we assume wrong size in svgio filter which we tried to "fix" outside when we render svg to bitmap. This reverts the "fix" and is now practically the same when rendering a svg graphic (might be good to combine in the future). The fix for svgio is fixed in a different commit. Change-Id: I43ee35d3220b3a750b8f72f22085f6a34b9d26b8 Reviewed-on: https://gerrit.libreoffice.org/47497 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/bitmap/BitmapTools.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index ff8bf5cbf2d1..f0aa8ccecf33 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -67,13 +67,10 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx,
uno::Sequence<beans::PropertyValue> aViewParameters;
- const sal_Int32 nCount(aPrimitiveSequence.getLength());
geometry::RealRectangle2D aRealRect;
basegfx::B2DRange aRange;
- for (sal_Int32 a = 0; a < nCount; ++a)
+ for (Primitive2DReference const & xReference : aPrimitiveSequence)
{
- const Primitive2DReference xReference(aPrimitiveSequence[a]);
-
if (xReference.is())
{
aRealRect = xReference->getRange(aViewParameters);
@@ -81,10 +78,10 @@ void loadFromSvg(SvStream& rStream, const OUString& sPath, BitmapEx& rBitmapEx,
}
}
- aRealRect.X1 = 0;
- aRealRect.Y1 = 0;
- aRealRect.X2 = aRange.getMaxX() - aRange.getMinX();
- aRealRect.Y2 = aRange.getMaxY() - aRange.getMinY();
+ aRealRect.X1 = aRange.getMinX();
+ aRealRect.Y1 = aRange.getMinY();
+ aRealRect.X2 = aRange.getMaxX();
+ aRealRect.Y2 = aRange.getMaxY();
double nDPI = 96 * fScalingFactor;