From e9ad79419ae2239d1887e8139568fd570777951f Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Wed, 10 Feb 2016 00:43:21 +0100 Subject: [PATCH] tdf#97538 expand canvas to show whole image If no canvas size is given, the canvas is calculated from content. If the left/top position of the content is not (0|0), the canvas has to be expanded to show the whole image. Browsers clip the image for negative left/top. The patch follows this behavior and therefore do not translate the content but adds left and top. Change-Id: Ica6cc345aeeb62397bac3bbaf3e6c960d83a970e --- helpcontent2 | 2 +- svgio/source/svgreader/svgsvgnode.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/helpcontent2 b/helpcontent2 index 8d35a0b..4b1bb98 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 8d35a0b9aadde3a5939008df0fd71dc83153442a +Subproject commit 4b1bb982611b888fa7c4b11c614ea32c54f980a2 diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx index 79697c1..36b19d3 100644 --- a/svgio/source/svgreader/svgsvgnode.cxx +++ b/svgio/source/svgreader/svgsvgnode.cxx @@ -563,8 +563,10 @@ namespace svgio drawinglayer::geometry::ViewInformation2D())); const double fChildWidth(aChildRange.getWidth()); const double fChildHeight(aChildRange.getHeight()); - fW = bWidthIsAbsolute ? getWidth().solveNonPercentage(*this) : fChildWidth; - fH = bHeightIsAbsolute ? getHeight().solveNonPercentage(*this) : fChildHeight; + const double fChildLeft(aChildRange.getMinX()); + const double fChildTop(aChildRange.getMinY()); + fW = bWidthIsAbsolute ? getWidth().solveNonPercentage(*this) : fChildWidth + fChildLeft; + fH = bHeightIsAbsolute ? getHeight().solveNonPercentage(*this) : fChildHeight + fChildTop; } // SVG 1.1 defines in section 5.1.2 that x,y has no meanig for the outermost SVG element. aSvgCanvasRange = basegfx::B2DRange(0.0, 0.0, fW, fH); -- 2.4.5