Created attachment 187965 [details] Gradient with last stop at offset 0.69 (1) Open attached document. Select the shape and open Area-dialog from the context menu of the shape. Click 'Add' button to add the gradient to the user gradient palette. Enter a name. OK. Notice that the offset of the last color stop has changed. Or (2) Open attached document. Select the shape and open Area-dialog from the context menu of the shape. Change the value of the 'Transition start' field to a different value. Click into any other field to update the setting. Notice that the offset of the last color stop has changed. The changed offset is already visible in the preview in the dialog. Hi Armin, do you have a code pointer for me, where this change might happen?
Don't see an issue on Linux/kf5.
Created attachment 187984 [details] left original, right after using Area dialog The left side is a screen shot of the original shape. The right side is a screen shot after changing the transition start from 20% to 22%. Notice that the center of the arc is now blue instead of white.
Reproduced in: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: ec60d354359067f8c5c686ef2239ee705916de43 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded Centre offset is lost as soon as any gradient setting is changed (or saving it as a preset).
While working on problems with the 'Increment' setting in die Gradient dialog (e.g. bug 107787) I stumble across a possible for this issue. The member m_aColorStops of SvxGradientTabPage is used so that it only carries the inner stops of a multicolor gradient. When building a basegfx::BGradient, then the first and last color is taken from the color fields of the dialog and forced to offset 0 and 1 respectively and only the intermediate stops are taken from m_aColorStops. That is likely a leftover. With current implementation basegfx::BGradient is used in the first place, and start and end color are derived from it. The relevant locations are in the various versions of createColorStops() method. For example from tpgradnt.cxx: 640 basegfx::BColorStops SvxGradientTabPage::createColorStops() 641 { 642 basegfx::BColorStops aColorStops; 643 644 aColorStops.emplace_back(0.0, m_xLbColorFrom->GetSelectEntryColor().getBColor()); 645 646 if(!m_aColorStops.empty()) 647 { 648 aColorStops.insert(aColorStops.begin(), m_aColorStops.begin(), m_aColorStops.end()); 649 } 650 651 aColorStops.emplace_back(1.0, m_xLbColorTo->GetSelectEntryColor().getBColor()); 652 653 return aColorStops; 654 } All uses of m_aColorStops have to be changed so that is contains the entire gradient. The dialog fields are only relevant for the color of the first and last stops, but not for their offsets. Armin, is my observation correct?
Regina Henschel committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/bb19bda1dc620f0f8662776d9818aedf45486994 tdf#155901 MCGR: preserve first and last gradient stop too It will be available in 24.2.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.
This needs the additional patch https://gerrit.libreoffice.org/c/core/+/153555 if backporting to Lo 7.6.
And this one too: https://cgit.freedesktop.org/libreoffice/core/commit/?id=4acf48b99804be712d2bd6e3e73c1f030ec637d5
Regina Henschel committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/4eb813aaabd88a13172effc467259b60d1831543 tdf#155901 MCGR: preserve first and last gradient stop too It will be available in 7.6.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.