diff options
author | Neil <nyamatongwe@gmail.com> | 2017-06-09 11:31:14 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-06-09 11:31:14 +1000 |
commit | 13324ebe2cc0f222228e00d84ceabd79d695c0fa (patch) | |
tree | b301543b52452f29a28011cf4970246ef1781ffe /src | |
parent | dbefd4e6e1d808505086b3374106ff26ac2a6452 (diff) | |
download | scintilla-mirror-13324ebe2cc0f222228e00d84ceabd79d695c0fa.tar.gz |
Backport: Use min and max from std instead of own version from platform.
Backport of changeset 6297:4bf96081f6e6.
Diffstat (limited to 'src')
-rw-r--r-- | src/Indicator.cxx | 7 | ||||
-rw-r--r-- | src/LineMarker.cxx | 3 |
2 files changed, 6 insertions, 4 deletions
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 <stdexcept> #include <vector> #include <map> +#include <algorithm> #include <memory> #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<int>(rcSquiggle.Width())); + int width = std::min(4000, static_cast<int>(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<int>(rcBox.Width()), 4000); + int width = std::min(static_cast<int>(rcBox.Width()), 4000); RGBAImage image(width, static_cast<int>(rcBox.Height()), 1.0, 0); // Draw horizontal lines top and bottom for (int x=0; x<width; x++) { @@ -156,7 +157,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r int x = static_cast<int>(rc.left); while (x < rc.right) { surface->MoveTo(x, ymid); - surface->LineTo(Platform::Minimum(x + 4, static_cast<int>(rc.right)), ymid); + surface->LineTo(std::min(x + 4, static_cast<int>(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 <stdexcept> #include <vector> #include <map> +#include <algorithm> #include <memory> #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<int>(rc.Width()), static_cast<int>(rc.Height())); + int minDim = std::min(static_cast<int>(rc.Width()), static_cast<int>(rc.Height())); minDim--; // Ensure does not go beyond edge int centreX = static_cast<int>(floor((rc.right + rc.left) / 2.0)); const int centreY = static_cast<int>(floor((rc.bottom + rc.top) / 2.0)); |