summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-12 15:38:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-16 07:53:49 +0100
commitbf4bbc3c2174b21577b8878bc3197923ba44a029 (patch)
tree22ec4b4da1bc2b86b6b27776fd64fd2b89a9ed3e /drawinglayer
parentb977a8786ff39f1348bafdbf2dd83e7008ed3086 (diff)
replace std::max(std::min()) with std::clamp
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx2
-rw-r--r--drawinglayer/source/tools/wmfemfhelper.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 6cd65d60b416..a4f0deb33fc4 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -298,7 +298,7 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
while(nXA < nXB)
{
// early-test Z values if we need to do anything at all
- const double fNewZ(std::max(0.0, std::min(double(0xffff), maIntZ.getVal())));
+ const double fNewZ(std::clamp(maIntZ.getVal(), 0.0, 65535.0));
const sal_uInt16 nNewZ(static_cast< sal_uInt16 >(fNewZ));
sal_uInt16& rOldZ(mrBuffer.getZ(nScanlineIndex));
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 583be2e38cf2..45e381f1c47a 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -1652,8 +1652,8 @@ namespace wmfemfhelper
{
double fRadiusX((nHor * 2.0) / (aRange.getWidth() > 0.0 ? aRange.getWidth() : 1.0));
double fRadiusY((nVer * 2.0) / (aRange.getHeight() > 0.0 ? aRange.getHeight() : 1.0));
- fRadiusX = std::max(0.0, std::min(1.0, fRadiusX));
- fRadiusY = std::max(0.0, std::min(1.0, fRadiusY));
+ fRadiusX = std::clamp(fRadiusX, 0.0, 1.0);
+ fRadiusY = std::clamp(fRadiusY, 0.0, 1.0);
aOutline = basegfx::utils::createPolygonFromRect(aRange, fRadiusX, fRadiusY);
}