Bug 133477 - EDITING Gradient types Square and Quadratic have incorrect center
Summary: EDITING Gradient types Square and Quadratic have incorrect center
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All All
: medium normal
Assignee: Tünde Tóth
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-28 13:17 UTC by NISZ LibreOffice Team
Modified: 2020-08-14 19:12 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer (10.61 KB, application/vnd.oasis.opendocument.text)
2020-05-28 13:17 UTC, NISZ LibreOffice Team
Details
Screenshot of the problem in Writer (109.03 KB, image/png)
2020-05-28 13:17 UTC, NISZ LibreOffice Team
Details
The example file in Writer 5.0 and 5.1 (158.60 KB, image/png)
2020-05-28 13:19 UTC, NISZ LibreOffice Team
Details
not a bug video (2.15 MB, video/mp4)
2020-05-28 19:06 UTC, BogdanB
Details
All gradient types in OOo3.2.1 (431.79 KB, application/vnd.oasis.opendocument.presentation)
2020-07-17 22:32 UTC, Regina Henschel
Details
Draft unit test document (9.23 KB, application/vnd.oasis.opendocument.text)
2020-07-23 12:08 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-05-28 13:17:01 UTC
Created attachment 161369 [details]
Example file from Writer

Attached document contains drawing shapes with Square and Quadratic gradient fill set. 
They have for the Center setting X=0%, Y=0% set, but their actual center is not positioned according to that, unlike for the Ellipsoid gradients case.


Steps to reproduce:
    1. Open attached document

Actual results:
The Quadratic and Square gradient types have incorrect center points.

Expected results:
The Quadratic and Square gradient types have correct center points.

LibreOffice details:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 41d8b41767032681a9897b7551f011d450e3725e
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

Also in:
Verzió: 6.0.0.3
Build az.: 64a0f66915f38c6217de274f0aa8e15618924765
CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: alapértelmezett; 
Területi beállítások: hu-HU (hu_HU); Calc: CL

Version: 5.1.0.3
Build ID: 5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; 
Locale: en-US (hu_HU)

But not in: (for the Square case)
Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: hu-HU (hu_HU)
Comment 1 NISZ LibreOffice Team 2020-05-28 13:17:57 UTC
Created attachment 161370 [details]
Screenshot of the problem in Writer
Comment 2 NISZ LibreOffice Team 2020-05-28 13:19:20 UTC
Created attachment 161371 [details]
The example file in Writer 5.0 and 5.1
Comment 3 BogdanB 2020-05-28 19:06:15 UTC
Created attachment 161382 [details]
not a bug video

It's not a bug, it's a different angle.
See my video.

Version: 6.4.3.2
Build ID: libreoffice-6.4.3.2-snap1
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 4 Tomaz Vajngerl 2020-05-28 20:24:50 UTC
That would then mean it's a different bug and not that there is no bug, wouldn't it?
Comment 5 BogdanB 2020-05-28 21:00:07 UTC
Agree.
The angle should not change.
Comment 6 Regina Henschel 2020-07-17 22:32:31 UTC
Created attachment 163213 [details]
All gradient types in OOo3.2.1

The file "All gradient types in OOo3.2.1" contains the gradient types "square", "rectangular", "radial" and "ellipsoid" with X-Offset 25% and Y-Offset 20% on shapes with width=4cm and height=10cm.

In LibreOffice 7, I see that "square" has a wrong x-position of the gradient center (slides 2 and 3). All other gradients are correct. The error exists in AOO4 too, so nothing new in LibreOffice.

The file contains for each case the shapes and a bitmap. And it contains slides, which explain how the gradient size is determined and how the gradients are build. OOo1.1.5 had slightly different methods in its sxi.

I have not checked, whether border is correct. Border is always 0 in the examples.
Comment 7 Regina Henschel 2020-07-17 23:15:00 UTC
BTW, "quadric" in UI = "square" in file
     "square" in UI = "rectangular" in file

The comparison between 5.0 and 5.1 shows, that 5.0 ignores the angle. So 5.0 is wrong.
Comment 8 László Németh 2020-07-23 12:08:31 UTC
Created attachment 163448 [details]
Draft unit test document
Comment 9 Commit Notification 2020-08-07 10:03:41 UTC
Tünde Tóth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/52f8e0b6f09be0e8e8a068edef2017d45d5a1892

tdf#133477 basegfx: fix center of rotated gradients

It will be available in 7.1.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 10 BogdanB 2020-08-14 19:12:24 UTC
Verified in
Version: 7.1.0.0.alpha0+
Build ID: 6ad2f463784a24c566477cdd60ae729651bb8564
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded