aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaView.mm
diff options
context:
space:
mode:
authormitchell <unknown>2019-03-31 23:20:01 -0400
committermitchell <unknown>2019-03-31 23:20:01 -0400
commit2c20e36f4ec739fd0887aceda589fce2c1757342 (patch)
tree7a00c34eab91ecec5e28a45df72f22d3c99d8701 /cocoa/ScintillaView.mm
parentde07b9abd6711d657c170de23871ddb5503a1011 (diff)
downloadscintilla-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 'cocoa/ScintillaView.mm')
-rw-r--r--cocoa/ScintillaView.mm6
1 files changed, 4 insertions, 2 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index 5ff9457d4..d1816a25d 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -9,6 +9,8 @@
* This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
*/
+#include <cmath>
+
#include <vector>
#import "Platform.h"
@@ -811,14 +813,14 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor)
// Only snap for positions inside the document - allow outside
// for overshoot.
long lineHeight = mOwner.backend->WndProc(SCI_TEXTHEIGHT, 0, 0);
- rc.origin.y = roundf(static_cast<XYPOSITION>(rc.origin.y) / lineHeight) * lineHeight;
+ rc.origin.y = std::round(static_cast<XYPOSITION>(rc.origin.y) / lineHeight) * lineHeight;
}
// Snap to whole points - on retina displays this avoids visual debris
// when scrolling horizontally.
if ((rc.origin.x > 0) && (NSMaxX(rc) < contentRect.size.width)) {
// Only snap for positions inside the document - allow outside
// for overshoot.
- rc.origin.x = roundf(static_cast<XYPOSITION>(rc.origin.x));
+ rc.origin.x = std::round(static_cast<XYPOSITION>(rc.origin.x));
}
return rc;
}