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 --- cui/source/inc/cuitabarea.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cui/source/inc') diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 2d6c713236da..4e766c76e57d 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -169,7 +169,7 @@ class SvxTransparenceTabPage : public SfxTabPage std::unique_ptr m_xCtlBitmapPreview; std::unique_ptr m_xCtlXRectPreview; - // 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_LINK(ClickTransOffHdl_Impl, weld::Toggleable&, void); @@ -187,7 +187,7 @@ class SvxTransparenceTabPage : public SfxTabPage bool InitPreview ( const SfxItemSet& rSet ); void InvalidatePreview (bool bEnable = true ); - // 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(); public: @@ -367,7 +367,7 @@ private: XFillAttrSetItem m_aXFillAttr; SfxItemSet& m_rXFSet; - // 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 m_aColorStops; SvxXRectPreview m_aCtlPreview; @@ -409,7 +409,7 @@ private: void SetControlState_Impl( css::awt::GradientStyle eXGS ); sal_Int32 SearchGradientList(std::u16string_view rGradientName); - // 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(); public: -- cgit