summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
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);
}