https://bugs.documentfoundation.org/show_bug.cgi?id=149468
Bug ID: 149468
Summary: Scaling for draw:path-stretchpoint-x is wrongly
triggered
Product: LibreOffice
Version: Inherited From OOo
Hardware: x86-64 (AMD64)
URL: https://docs.oasis-open.org/office/OpenDocument/v1.3/o
s/part3-schema/OpenDocument-v1.3-os-part3-schema.html#
attribute-draw_path-stretchpoint-x
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
Blocks: 108198
Created attachment 180604
--> https://bugs.documentfoundation.org/attachment.cgi?id=180604&action=edit
The left, yellow shape is faulty
The behavior for draw:path-stretchpoint-x is specified in 19.204 ODF 1.3 (see
URL) as
"If specified, and if the x/y aspect ratio of the svg:viewBox 19.574 is lower
than the x/y aspect ratio of the shape size then the whole path is stretched
horizontally at draw:path-stretchpoint-x."
The attached document contains a yellow, a blue, a green and a red custom
shape. The yellow and green shapes have an attribute draw:path-stretchpoint-x
set. The blue and red shape have the same coordinates, but they have no
draw:path-stretchpoint-x attribute.
The yellow shape has the attributes svg:width="6cm", svg:height="3cm" and
svg:viewBox="0 0 21600 10800". So its x/y aspect ratio of the svg:viewBox is
21600/10800=2 and the x/y aspect ratio of its size is 6cm/3cm=2.
So the values are equal and therefore there should be no stretching. That means
it should look the same as the blue shape.
The green shape has the attributes svg:width="6cm", svg:height="6cm" and
svg:viewBox="0 0 21600 21600". So its x/y aspect ratio of the svg:viewBox is
21600/21600=1 and the x/y aspect ratio of its size is 6cm/6cm=1.
Here it works.
The error is in method EnhancedCustomShape2d::SetPathSize()
689 fXRatio = static_cast<double>(aLogicRect.GetWidth()) /
static_cast<double>(aLogicRect.GetHeight());
690 if ( fXRatio > 1 )
691 fXScale /= fXRatio;
692 else
693 fXRatio = 1.0;
Here it tests whether the shape width of the shape is larger than the shape
height. But being ODF conform the ratio viewBoxWidht/viewBoxHeight has to be
compared to ratio shapeWidth/shapeHeight.
Variable aLogicRect has the size of the shape and variables nCoordWidth and
nCoordHeight have the size of viewBox.
https://opengrok.libreoffice.org/xref/core/svx/source/customshapes/EnhancedCustomShape2d.cxx?r=0a1bfe1e#690
Referenced Bugs:
https://bugs.documentfoundation.org/show_bug.cgi?id=108198
[Bug 108198] [META] ODF export is unsuitable or invalid XML
--
You are receiving this mail because:
You are the assignee for the bug.