From 13324ebe2cc0f222228e00d84ceabd79d695c0fa Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 9 Jun 2017 11:31:14 +1000 Subject: Backport: Use min and max from std instead of own version from platform. Backport of changeset 6297:4bf96081f6e6. --- src/Indicator.cxx | 7 ++++--- src/LineMarker.cxx | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Indicator.cxx b/src/Indicator.cxx index 16fc5912d..b59f1804f 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "Platform.h" @@ -55,7 +56,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r } else if (sacDraw.style == INDIC_SQUIGGLEPIXMAP) { PRectangle rcSquiggle = PixelGridAlign(rc); - int width = Platform::Minimum(4000, static_cast(rcSquiggle.Width())); + int width = std::min(4000, static_cast(rcSquiggle.Width())); RGBAImage image(width, 3, 1.0, 0); enum { alphaFull = 0xff, alphaSide = 0x2f, alphaSide2=0x5f }; for (int x = 0; x < width; x++) { @@ -137,7 +138,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r rcBox.top = rcLine.top + 1; rcBox.bottom = rcLine.bottom; // Cap width at 4000 to avoid large allocations when mistakes made - int width = Platform::Minimum(static_cast(rcBox.Width()), 4000); + int width = std::min(static_cast(rcBox.Width()), 4000); RGBAImage image(width, static_cast(rcBox.Height()), 1.0, 0); // Draw horizontal lines top and bottom for (int x=0; x(rc.left); while (x < rc.right) { surface->MoveTo(x, ymid); - surface->LineTo(Platform::Minimum(x + 4, static_cast(rc.right)), ymid); + surface->LineTo(std::min(x + 4, static_cast(rc.right)), ymid); x += 7; } } else if (sacDraw.style == INDIC_DOTS) { diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index d80a3c78c..5f8243ff8 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "Platform.h" @@ -117,7 +118,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac PRectangle rc = rcWhole; rc.top++; rc.bottom--; - int minDim = Platform::Minimum(static_cast(rc.Width()), static_cast(rc.Height())); + int minDim = std::min(static_cast(rc.Width()), static_cast(rc.Height())); minDim--; // Ensure does not go beyond edge int centreX = static_cast(floor((rc.right + rc.left) / 2.0)); const int centreY = static_cast(floor((rc.bottom + rc.top) / 2.0)); -- cgit v1.2.3