summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-02-15 10:45:10 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-02-15 14:46:11 +0000
commitea1d3d11ca113042a99effc168da834894005370 (patch)
tree60aafa53ee15614b39b329c3510bbca913305f67 /svx/source
parentd88fa033f02b70e28dbef6b42a4e73abc24c3a60 (diff)
MCGR: Add GradientSteps to GeoTexSvxGradient
Move GradientSteps data to GeoTexSvxGradient and adapt interfaces. Also move tooling to more isolated place in gradienttools in basegfx. Keep everything still compatible, the work will be now to adapt all six different derivations of GeoTexSvxGradient to make use of the evtl. given GradientSteps. Change-Id: Iaa212763c603d46de0a94b1b203b979bb7ce359d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147050 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/sdr/attribute/sdrallfillattributeshelper.cxx1
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx13
2 files changed, 13 insertions, 1 deletions
diff --git a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx
index e7bd26ce4f4f..720adcf26a78 100644
--- a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx
+++ b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx
@@ -21,6 +21,7 @@
#include <sdr/primitive2d/sdrdecompositiontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/utils/gradienttools.hxx>
#include <drawinglayer/attribute/fillhatchattribute.hxx>
#include <drawinglayer/attribute/sdrfillgraphicattribute.hxx>
#include <vcl/graph.hxx>
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index f79ea50e5a88..434be3ee3197 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -61,6 +61,7 @@
#include <vcl/svapp.hxx>
#include <vcl/GraphicLoader.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <basegfx/utils/gradienttools.hxx>
#include <svx/svx3ditems.hxx>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
@@ -492,6 +493,16 @@ namespace drawinglayer::primitive2d
aEnd = interpolate(aBlack, aEnd, static_cast<double>(nEndIntens) * 0.01);
}
+ basegfx::ColorSteps aColorSteps;
+
+ // test code here, will be removed later
+ // if(false)
+ // {
+ // aStart = basegfx::BColor(1.0, 0.0, 0.0); // red
+ // aEnd = basegfx::BColor(0.0, 0.0, 1.0); // blue
+ // aColorSteps.emplace_back(0.25, basegfx::BColor(0.0, 1.0, 0.0)); // green@25%
+ // }
+
aGradient = attribute::FillGradientAttribute(
XGradientStyleToGradientStyle(aXGradient.GetGradientStyle()),
static_cast<double>(aXGradient.GetBorder()) * 0.01,
@@ -500,7 +511,7 @@ namespace drawinglayer::primitive2d
toRadians(aXGradient.GetAngle()),
aStart,
aEnd,
- nullptr,
+ aColorSteps.empty() ? nullptr : &aColorSteps,
rSet.Get(XATTR_GRADIENTSTEPCOUNT).GetValue());
break;