aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/ScintillaGTK.cxx
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 /gtk/ScintillaGTK.cxx
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 'gtk/ScintillaGTK.cxx')
-rw-r--r--gtk/ScintillaGTK.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 24d2ef212..129da2b07 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1680,8 +1680,8 @@ gint ScintillaGTK::PressThis(GdkEventButton *event) {
evbtn = gdk_event_copy(reinterpret_cast<GdkEvent *>(event));
buttonMouse = event->button;
Point pt;
- pt.x = floor(event->x);
- pt.y = floor(event->y);
+ pt.x = std::floor(event->x);
+ pt.y = std::floor(event->y);
PRectangle rcClient = GetClientRectangle();
//Platform::DebugPrintf("Press %0d,%0d in %0d,%0d %0d,%0d\n",
// pt.x, pt.y, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
@@ -1810,12 +1810,12 @@ gint ScintillaGTK::ScrollEvent(GtkWidget *widget, GdkEventScroll *event) {
sciThis->smoothScrollY += event->delta_y * smoothScrollFactor;
sciThis->smoothScrollX += event->delta_x * smoothScrollFactor;;
if (ABS(sciThis->smoothScrollY) >= 1.0) {
- const int scrollLines = trunc(sciThis->smoothScrollY);
+ const int scrollLines = std::trunc(sciThis->smoothScrollY);
sciThis->ScrollTo(sciThis->topLine + scrollLines);
sciThis->smoothScrollY -= scrollLines;
}
if (ABS(sciThis->smoothScrollX) >= 1.0) {
- const int scrollPixels = trunc(sciThis->smoothScrollX);
+ const int scrollPixels = std::trunc(sciThis->smoothScrollX);
sciThis->HorizontalScrollTo(sciThis->xOffset + scrollPixels);
sciThis->smoothScrollX -= scrollPixels;
}