summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-02-23 11:22:31 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-02-23 13:06:06 +0000
commit94cdbfb9316ab3b04327f960fa40aee07abbba91 (patch)
treecd905bd1eaa7fd934ee1e3faf841f7ea9530c098 /basegfx
parentbddc275d1e25b4d528e884179bac1b712f6c45a2 (diff)
MCGR: Adapted GradientAxial to make use of MCGR
Added to make GradientAxial work using the MCGR as 2nd of six types. This one was complicated since it uses the gradient(s) 'reversed' when you look at it, from outside to inside. Had to do quite some tickeling to get it all work, but looks good now. For modifyBColor I Could re-use the started tooling as planned. To get the reverse usage working I ended up in 1st adapting the previous usage to make more use of std::iterator and reverse_iterator to be able to use the reversed state of the ColorSteps more 'controlled' as if trying to adapt the numerical indices to the vector (that ended in chaos). It is still 100% backward-compatible, so as long as there is no source using this it will stay invisible - by purpose. Tests look good with this one, see the static variable nUseGradientSteps. Change-Id: I0117ec9a24b5e55869b3e2741c67fb87b549db97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147510 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/tools/gradienttools.cxx18
1 files changed, 2 insertions, 16 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx
index 4aa909fcf58c..b27443898f4e 100644
--- a/basegfx/source/tools/gradienttools.cxx
+++ b/basegfx/source/tools/gradienttools.cxx
@@ -467,7 +467,7 @@ namespace basegfx
{
const B2DPoint aCoor(rGradInfo.getBackTextureTransform() * rUV);
- // Ignore Y, this is not needed at all for Y-Oriented gradients
+ // Ignore X, this is not needed at all for Y-Oriented gradients
// if(aCoor.getX() < 0.0 || aCoor.getX() > 1.0)
// {
// return 0.0;
@@ -483,13 +483,6 @@ namespace basegfx
return 1.0; // end value for outside
}
- // const sal_uInt32 nSteps(rGradInfo.getRequestedSteps());
-
- // if(nSteps)
- // {
- // return floor(aCoor.getY() * nSteps) / double(nSteps - 1);
- // }
-
return aCoor.getY();
}
@@ -497,7 +490,7 @@ namespace basegfx
{
const B2DPoint aCoor(rGradInfo.getBackTextureTransform() * rUV);
- // Ignore Y, this is not needed at all for Y-Oriented gradients
+ // Ignore X, this is not needed at all for Y-Oriented gradients
//if(aCoor.getX() < 0.0 || aCoor.getX() > 1.0)
//{
// return 0.0;
@@ -510,13 +503,6 @@ namespace basegfx
return 1.0; // use end value when outside in Y
}
- const sal_uInt32 nSteps(rGradInfo.getRequestedSteps());
-
- if(nSteps)
- {
- return floor(fAbsY * nSteps) / double(nSteps - 1);
- }
-
return fAbsY;
}