From bb19bda1dc620f0f8662776d9818aedf45486994 Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Wed, 21 Jun 2023 15:01:20 +0200 Subject: tdf#155901 MCGR: preserve first and last gradient stop too Error was, that only the in-between gradient stops were preserve. First stop was set with fixed offset 0, last stop with fixed offset 1. The offsets of first and last gradient stop of the original gradient were lost. Now in all cases (hopefully) the complete gradient stops vector is preserved and the original offset is used, if e.g. the user changes the color. For calculating transparence the indirect way over Color is removed. Instead percent is directly transformed to the 0..1 values of BColor. That avoids rounding errors. Change-Id: Icdf699a6c2e9c6289d2f77033858448e58396a60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153395 Tested-by: Jenkins Reviewed-by: Regina Henschel --- include/svx/sidebar/AreaPropertyPanelBase.hxx | 4 ++-- include/svx/sidebar/AreaTransparencyGradientPopup.hxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include/svx') diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index 8e822dfd4f47..c2c967a8333b 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -151,7 +151,7 @@ protected: std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem; std::unique_ptr< SfxUInt16Item > mpTransparenceItem; - // MCGR: Preserve in-between ColorStops until we have an UI to edit these + // MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops maColorStops; DECL_DLLPRIVATE_LINK(SelectFillTypeHdl, weld::ComboBox&, void ); @@ -169,7 +169,7 @@ protected: void SelectFillAttrHdl_Impl(); void FillStyleChanged(bool bUpdateModel); - // MCGR: Preserve in-between ColorStops until we have an UI to edit these + // MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops createColorStops(); }; diff --git a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx index bd6b24b6c828..6caf6487417b 100644 --- a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx +++ b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx @@ -45,11 +45,11 @@ private: std::unique_ptr mxMtrTrgrEndValue; std::unique_ptr mxMtrTrgrBorder; - // MCGR: Preserve in-between ColorStops until we have an UI to edit these + // MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops maColorStops; void InitStatus(XFillFloatTransparenceItem const* pGradientItem); - void ExecuteValueModify(sal_uInt8 nStartCol, sal_uInt8 nEndCol); + void ExecuteValueModify(); DECL_LINK(ModifiedTrgrHdl_Impl, weld::MetricSpinButton&, void); DECL_LINK(Left_Click45_Impl, const OUString&, void); DECL_LINK(Right_Click45_Impl, const OUString&, void); -- cgit