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.
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.
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.
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.