summaryrefslogtreecommitdiff
path: root/fluid/nodes/Window_Node.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'fluid/nodes/Window_Node.cxx')
-rw-r--r--fluid/nodes/Window_Node.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/fluid/nodes/Window_Node.cxx b/fluid/nodes/Window_Node.cxx
index 0ea3b306f..7e90f8272 100644
--- a/fluid/nodes/Window_Node.cxx
+++ b/fluid/nodes/Window_Node.cxx
@@ -49,9 +49,13 @@
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
-#undef min
-#undef max
-#include <algorithm>
+
+#ifndef MIN
+#define MIN(a,b) ((a)<=(b) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a,b) ((a)>=(b) ? (a) : (b))
+#endif
extern Fl_Window *the_panel;
extern void draw_width(int x, int y, int r, Fl_Align a);
@@ -337,7 +341,7 @@ void Window_Node::ideal_size(int &w, int &h) {
Fl_Window *win = Fluid.main_window;
int screen = Fl::screen_num(win->x(), win->y());
Fl::screen_work_area(sx, sy, sw, sh, screen);
- w = std::min(w, sw*3/4); h = std::min(h, sh*3/4);
+ w = MIN(w, sw*3/4); h = MIN(h, sh*3/4);
}
fld::app::Snap_Action::better_size(w, h);
}
@@ -534,10 +538,10 @@ void Window_Node::draw_overlaps() {
if (p->level==q->level && p->is_true_widget()) {
Widget_Node *wp = (Widget_Node*)p;
if (wp->o->visible()) {
- int px = std::max(x, wp->o->x());
- int py = std::max(y, wp->o->y());
- int pr = std::min(r, wp->o->x() + wp->o->w());
- int pb = std::min(b, wp->o->y() + wp->o->h());
+ int px = MAX(x, wp->o->x());
+ int py = MAX(y, wp->o->y());
+ int pr = MIN(r, wp->o->x() + wp->o->w());
+ int pb = MIN(b, wp->o->y() + wp->o->h());
if (pr > px && pb > py)
fd_hatch(px, py, pr-px, pb-py);
}