summaryrefslogtreecommitdiff
path: root/drawinglayer/inc
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-03-21 13:13:15 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-03-21 15:53:06 +0000
commit808c5bf66370f78f36e98887db0848ee7e55bb3a (patch)
tree11ddcb034efd1d32663a774a85797fff390762e8 /drawinglayer/inc
parent5ccbdcf182851375486386c0df8bb3f04cf2f9cd (diff)
MCGR: Model data changes for ColorSteps (II)
The biggest change here is to allow multiple ColorStops with the same Offset. That allows to define gradients with 'hard' color changes at any place using two ColorStops with the same Offset and different Colors. This required quite some adaptions, but works well. Also removed in this context checking for all Colors being the same to not mix up things. Also works well. Also changed the need for having Start/EndColors AKA ColorStops for 0.0 and 1.0 in place, instead 'imply' the 1st ColorStop to also define the StartColor and the last one the EndColor. This allows e.g. Gradient definitions with two GradientStops at the same Offset e.g. 0.5 with different colors to already define a full Gradient. Also added a tooling method to reverse ColorSteps, which changes the order and mirrors the Offsets (what even keeps an existing sort valid). This is useful e.g. for GradientAxial which is the only one where for decomposition the Gradient had to be interpreted 'reverse' since it's defined from center to edge, but for creating correct filled polygons to represent this the inverse order had to be used, creating polygons from edge to center. This led to 'wild' code for this one of six cases and prevented unifications with the other cases (also made your brain flip). Thus I adapted this now to use the reversed ColorSteps consequently, and the same principle loops than the other implementations to make things easier for the future and to use common tooling. Change-Id: If2943348d17d5b9cd165f4d78f22638a1dff5237 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149208 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer/inc')
-rw-r--r--drawinglayer/inc/texture/texture.hxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/drawinglayer/inc/texture/texture.hxx b/drawinglayer/inc/texture/texture.hxx
index 8eff5bee261a..8a5c411d320f 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -60,6 +60,9 @@ namespace drawinglayer::texture
basegfx::ColorStops mnColorStops;
double mfBorder;
+ // check if we need last-ColorStop-correction
+ bool checkPenultimate();
+
public:
GeoTexSvxGradient(
const basegfx::B2DRange& rDefinitionRange,