diff options
author | mitchell <unknown> | 2019-03-31 23:20:01 -0400 |
---|---|---|
committer | mitchell <unknown> | 2019-03-31 23:20:01 -0400 |
commit | 2c20e36f4ec739fd0887aceda589fce2c1757342 (patch) | |
tree | 7a00c34eab91ecec5e28a45df72f22d3c99d8701 /src/Indicator.cxx | |
parent | de07b9abd6711d657c170de23871ddb5503a1011 (diff) | |
download | scintilla-mirror-2c20e36f4ec739fd0887aceda589fce2c1757342.tar.gz |
Backport: Use generic versions of ceil, floor, round, lround, trunc from <cmath>.
Backport of changeset 7329:2662ef098d93, but without std::round and std::lround,
since older Mac OSX SDKs may not have them.
Diffstat (limited to 'src/Indicator.cxx')
-rw-r--r-- | src/Indicator.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx index 544bd571d..24cd40820 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -25,8 +25,8 @@ using namespace Scintilla; static PRectangle PixelGridAlign(const PRectangle &rc) { // Move left and right side to nearest pixel to avoid blurry visuals - return PRectangle(round(rc.left), floor(rc.top), - round(rc.right), floor(rc.bottom)); + return PRectangle(round(rc.left), std::floor(rc.top), + round(rc.right), std::floor(rc.bottom)); } void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, DrawState drawState, int value) const { @@ -201,10 +201,10 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r surface->FillRectangle(rcComposition, sacDraw.fore); } else if (sacDraw.style == INDIC_POINT || sacDraw.style == INDIC_POINTCHARACTER) { if (rcCharacter.Width() >= 0.1) { - const XYPOSITION pixelHeight = floor(rc.Height() - 1.0f); // 1 pixel onto next line if multiphase + const XYPOSITION pixelHeight = std::floor(rc.Height() - 1.0f); // 1 pixel onto next line if multiphase const XYPOSITION x = (sacDraw.style == INDIC_POINT) ? (rcCharacter.left) : ((rcCharacter.right + rcCharacter.left) / 2); const XYPOSITION ix = round(x); - const XYPOSITION iy = floor(rc.top + 1.0f); + const XYPOSITION iy = std::floor(rc.top + 1.0f); Point pts[] = { Point(ix - pixelHeight, iy + pixelHeight), // Left Point(ix + pixelHeight, iy + pixelHeight), // Right |