summaryrefslogtreecommitdiff
path: root/basegfx/source/tools
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-02-24 10:56:43 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-02-24 16:22:36 +0000
commitae51dfb2379a9e9183afa9a1e5ee4fe4f4f0f7ef (patch)
tree2b7296fa3bb4ec0e53fb235ad9d18311a6bfa7ff /basegfx/source/tools
parent0ccea0dd6e50199af4a7aae75d691b32c853b177 (diff)
MCGR: Adapted GradientRadial to make use of MCGR
Added to make GradientRadial work using the MCGR. 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: Ie7134fe2995b23ceb180c7daf3f5b2310c8a8a78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147617 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'basegfx/source/tools')
-rw-r--r--basegfx/source/tools/gradienttools.cxx10
1 files changed, 1 insertions, 9 deletions
diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx
index b27443898f4e..37671374262c 100644
--- a/basegfx/source/tools/gradienttools.cxx
+++ b/basegfx/source/tools/gradienttools.cxx
@@ -515,15 +515,7 @@ namespace basegfx
return 0.0;
}
- const double t(1.0 - std::hypot(aCoor.getX(), aCoor.getY()));
- const sal_uInt32 nSteps(rGradInfo.getRequestedSteps());
-
- if(nSteps && t < 1.0)
- {
- return floor(t * nSteps) / double(nSteps - 1);
- }
-
- return t;
+ return 1.0 - std::hypot(aCoor.getX(), aCoor.getY());
}
double getEllipticalGradientAlpha(const B2DPoint& rUV, const ODFGradientInfo& rGradInfo)