Bug 166140 - Add dynamic sizing of radial gradient diameter
Summary: Add dynamic sizing of radial gradient diameter
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Object-Fill-Gradient
  Show dependency treegraph
 
Reported: 2025-04-11 12:43 UTC by Gabor Kelemen (allotropia)
Modified: 2025-04-20 23:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example with manually set <a:fillToRect> (35.58 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2025-04-11 23:05 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2025-04-11 12:43:54 UTC
This is a followup to bug 154858

In attachment 200250 [details] there is demonstration of radial gradient presets placed in the corners of rectangle shapes. For a screenshot, see attachment 200252 [details].
In LO this is now imported correctly as radial gradient, but the algorithm is more simple than in MSO, so the look is different.

What is needed here a different algorithm that considers the center point of the gradient, and the size of the shape. Then it changes the gradients radius so that it covers the entire width/length of the shape.

1. Open  attachment 200250 [details] in Impress
-> The gradients in the first slide do not look like their image made in PP, visible on the second slide.
Comment 1 Regina Henschel 2025-04-11 23:03:24 UTC
ODF has <svg:radialGradient> (16.42.3 ODF 1.3) to describe such radial gradients. There is already bug 48392 for the request to implement it.

For rendering perhaps member mpFillGeometryDefiningShape of the class SdrObject can be used.

It is not clear, how MSO calculates the gradient center in case the attributes in the <a:fillToRect> element do not evaluate to a point. I have ask about it in  https://learn.microsoft.com/en-us/answers/questions/2247174/how-is-attribute-filltorect-evaluated-for-a-gradie

In case of the presets with gradient center in the corner of the bounding box, the radius of the gradient circle is the distance to the opposite corner.
Comment 2 Regina Henschel 2025-04-11 23:05:26 UTC
Created attachment 200314 [details]
Example with manually set <a:fillToRect>

This is the file from which I have made the screenshots to be seen in the mentioned question to Microsoft.
Comment 3 Regina Henschel 2025-04-12 23:43:05 UTC
The rectangular gradient has the same problem. It becomes visible, when you use a preset with center in the corner of the bounding box of the shape.