diff options
Diffstat (limited to 'fluid/nodes')
| -rw-r--r-- | fluid/nodes/Widget_Node.cxx | 18 | ||||
| -rw-r--r-- | fluid/nodes/Window_Node.cxx | 20 |
2 files changed, 23 insertions, 15 deletions
diff --git a/fluid/nodes/Widget_Node.cxx b/fluid/nodes/Widget_Node.cxx index 5b51db75e..b02e53e66 100644 --- a/fluid/nodes/Widget_Node.cxx +++ b/fluid/nodes/Widget_Node.cxx @@ -42,9 +42,13 @@ #include <stdio.h> #include <stdlib.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 using namespace fld; using namespace fld::proj; @@ -518,10 +522,10 @@ static void calculate_bbox(Node* p) { bbox_r = o->x() + o->w(); bbox_b = o->y() + o->h(); first = 0; } else { - bbox_x = std::min(bbox_x, o->x()); - bbox_y = std::min(bbox_y, o->y()); - bbox_r = std::max(bbox_r, o->x() + o->w()); - bbox_b = std::max(bbox_b, o->y() + o->h()); + bbox_x = MIN(bbox_x, o->x()); + bbox_y = MIN(bbox_y, o->y()); + bbox_r = MAX(bbox_r, o->x() + o->w()); + bbox_b = MAX(bbox_b, o->y() + o->h()); } } } 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); } |
