vcl/source/bitmap/BitmapTools.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
New commits: commit 691d92e312ca7c465deba8acc4ad71a5e89e6293 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Jan 6 23:34:44 2018 +0900 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Thu May 23 13:45:14 2019 +0200 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 <c...@libreoffice.org> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 9707a0017379317069383fd061384a91a8b46281) Reviewed-on: https://gerrit.libreoffice.org/72825 Reviewed-by: Tor Lillqvist <t...@collabora.com> Tested-by: Tor Lillqvist <t...@collabora.com> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits