diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-01-28 20:01:53 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-01-28 23:14:06 +0100 |
commit | a2f5a7d69d1bec0b5761e48d3feb5346193a969b (patch) | |
tree | 736df8dff65f56025ab4e4e169ec01673af02d5b /basegfx | |
parent | 67afa83d27ac8ce84810169741846499f452dfd1 (diff) |
basegfx: just use the std::clamp for clamping the input
Change-Id: Ia7d6c103956c8e3cebd6ebe656fd88586d33a9c8
Reviewed-on: https://gerrit.libreoffice.org/67032
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/polygon/b2dpolygontools.cxx | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 5b00b312587d..38d9bb192696 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -1509,24 +1509,8 @@ namespace basegfx const double fZero(0.0); const double fOne(1.0); - // crop to useful values - if(fTools::less(fRadiusX, fZero)) - { - fRadiusX = fZero; - } - else if(fTools::more(fRadiusX, fOne)) - { - fRadiusX = fOne; - } - - if(fTools::less(fRadiusY, fZero)) - { - fRadiusY = fZero; - } - else if(fTools::more(fRadiusY, fOne)) - { - fRadiusY = fOne; - } + fRadiusX = std::clamp(fRadiusX, 0.0, 1.0); + fRadiusY = std::clamp(fRadiusY, 0.0, 1.0); if(rtl::math::approxEqual(fZero, fRadiusX) || rtl::math::approxEqual(fZero, fRadiusY)) { |