diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2021-10-21 16:09:44 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2021-10-21 23:36:16 +0200 |
commit | 5ab21caf603ba0a1c95bbc94a29eebe3483d1599 (patch) | |
tree | 0377b708e09b909eb9d1e08990b7ef47f6698be7 /svx/source | |
parent | 827c0f9766f148520aed7fe3abe2b138a157a6d3 (diff) |
tdf#145245 correct relative position of extrusion
ODF specifies for draw:extrusion-depth, 'The draw:extrusion-depth
attribute specifies the depth of an extrusion. It takes two white space
separated values. The first value specifies the depth of the extrusion
in units, the second value specifies the fraction of the extrusion that
lies before a shape. The second value shall be in the range [0,1].'
The default for the second value is 0. Because LibreOffice has no UI to
change the value, the error becomes only visible, if you create own
custom shapes.
On import the ODF values are put in CustomShapeGeometry>Extrusion>
Depth. Method GetExtrusionDepth() calculates from that the length
values rBackwardDepth and rForwardDepth so that its sum is the depth.
CreateCustomShapeProperties() in escherex.cxx#2699 and
ApplyCustomShapeGeometryAttributes() in msdffimp.cxx#1684 use them in
the same sence.
But methods Create3DObject() and CalculateNewSnapRect() in
EnhancedCustomShape3d.cxx have used these values as if they were
coordinates.
I have keept the calculation in GetExtrusionDepth(), because it
reflects the meaning in ODF. I have corrected the signs in
Create3DObject() and CalculateNewSnapRect().
Change-Id: If275bb263b6f3d790f5893a69f38f8433acfbe7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123997
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape3d.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 2f13eb8b986b..b6e3e04234ab 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -304,7 +304,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( double fExtrusionBackward, fExtrusionForward; GetExtrusionDepth( rGeometryItem, pMap, fExtrusionBackward, fExtrusionForward ); - double fDepth = fExtrusionBackward - fExtrusionForward; + double fDepth = fExtrusionBackward + fExtrusionForward; if ( fDepth < 1.0 ) fDepth = 1.0; @@ -768,7 +768,7 @@ tools::Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( for ( i = 0; i < 4; i++ ) { - aBoundVolume.append(basegfx::B3DPoint(aPolygon[ static_cast<sal_uInt16>(i) ].X() - aCenter.X(), aPolygon[ static_cast<sal_uInt16>(i) ].Y() - aCenter.Y(), fExtrusionForward)); + aBoundVolume.append(basegfx::B3DPoint(aPolygon[ static_cast<sal_uInt16>(i) ].X() - aCenter.X(), aPolygon[ static_cast<sal_uInt16>(i) ].Y() - aCenter.Y(), -fExtrusionForward)); } for ( i = 0; i < 4; i++ ) |