Bug 145904 - X and Y of property RotationCenter is fraction of shape size
Summary: X and Y of property RotationCenter is fraction of shape size
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.4.0 target:7.3.0.0.beta2
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-26 23:00 UTC by Regina Henschel
Modified: 2021-12-17 10:58 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Extruded custom shape rectangle with non-default RotationCenter (26.50 KB, application/msword)
2021-11-26 23:00 UTC, Regina Henschel
Details
Extruded custom shape with non-default RotationCenter (10.49 KB, application/vnd.oasis.opendocument.text)
2021-11-26 23:08 UTC, Regina Henschel
Details
File with extrusion rotation center but zero rotation angle (14.06 KB, application/vnd.oasis.opendocument.text)
2021-11-30 14:12 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2021-11-26 23:00:19 UTC
Created attachment 176532 [details]
Extruded custom shape rectangle with non-default RotationCenter

Open attached document in Word and in LibreOffice. It contains an extruded rectangle in blue and a simple, not filled red rectangle. The blue rectangle should have approximately position and size of the red rectangle.

Problem is, that X and Y component of property RotationCenter are in fraction of shape size. But LibreOffice uses them internally as if they are absolute.
The error is not only in import/export with doc format, but with ODF too.

For discussion of the problem see https://lists.freedesktop.org/archives/libreoffice/2021-November/088073.html
Comment 1 Regina Henschel 2021-11-26 23:08:45 UTC
Created attachment 176533 [details]
Extruded custom shape with non-default RotationCenter

The custom shape has a RotationCenter (0 0.25 0). So the rotation center is in the middle between shape center and bottom edge of the shape. You see the position and size of the shape as handles of the snap rectangle, if you click on the custom shape.
The custom shape is rotated "Tilt down" with 90deg. In the projection of the rotated shape, the lower edge should be approximately in the middle between center and bottom edge of the snap rectangle of the shape.
Comment 2 Regina Henschel 2021-11-30 14:12:55 UTC
Created attachment 176599 [details]
File with extrusion rotation center but zero rotation angle

The file has attribute draw:extrusion-rotation-center="(-2000 0 0)", and the rotation angle is zero. But the existence of the attribute is already enough to shift the shape. So there is an additional error with attribute draw:extrusion-rotation-center besides the fact, that X- and Y-component are interpreted absolute.

The value -2000 is chosen for LibreOffice version 7.1, which interprets X- and Y-component as absolute value. When that is corrected, the attribute value needs to be "(-0.5 0 0)" for example, which means shift rotation center left by 50% of shape width.

The yellow shape in the image shows the unrotated diamond. The red square indicates the rotated diamond before extrusion.
Comment 3 Regina Henschel 2021-12-11 14:32:04 UTC
I'm going to work on it.
Comment 4 Commit Notification 2021-12-15 07:23:41 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/453c5b6214654b440fe1d3e926cddfb695e17f10

tdf#145904,tdf#145956 improve extrusion of custom shapes

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2021-12-15 12:35:56 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/90b925307da4066cd18fcbf31b903e948fa55e82

tdf#145904,tdf#145956 improve extrusion of custom shapes

It will be available in 7.3.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2021-12-17 00:33:41 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b9c159361abd79862b30412c433fb355d63299e2

tdf#145904,tdf#145956 unit test extrusion of shapes

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2021-12-17 10:58:20 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/e9d927b0a0ab56a7abdb7afad3c0fcc0c0c51e44

tdf#145904,tdf#145956 unit test extrusion of shapes

It will be available in 7.3.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.