diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-01-18 16:17:21 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-01-18 16:17:21 +0100 |
commit | 61988218606c52684c8121a8274245bde4d3dcf5 (patch) | |
tree | 99f633997916005ef3d457d220f36835a484aedf /src/GipfelWidget.cxx | |
parent | 7c3b29bde40fa215f35de1197c1ef0fc51f9c113 (diff) |
use std::min() std::max()
Diffstat (limited to 'src/GipfelWidget.cxx')
-rw-r--r-- | src/GipfelWidget.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx index eefefc4..cb0b3dc 100644 --- a/src/GipfelWidget.cxx +++ b/src/GipfelWidget.cxx @@ -15,6 +15,7 @@ #include <fcntl.h> #include <errno.h> #include <math.h> +#include <algorithm> #include <FL/Fl.H> #include <FL/Fl_Menu_Item.H> @@ -29,10 +30,6 @@ #define CROSS_SIZE 2 - -#define MAX(A,B) ((A)>(B)?(A):(B)) -#define MIN(A,B) ((A)<(B)?(A):(B)) - static double pi_d, deg2rad; static void center_cb(Fl_Widget *o, void *f); @@ -464,13 +461,13 @@ GipfelWidget::set_mountain(int m_x, int m_y) { damage(4, center_x + x() + old_x - 2*CROSS_SIZE - 1, center_y + y() + old_y + old_label_y - 2*CROSS_SIZE - 20, - MAX(20, cur_mountain->label_x) + 2*CROSS_SIZE + 2, - MAX(20, old_label_y) + 22 ); + std::max(20, cur_mountain->label_x) + 2*CROSS_SIZE + 2, + std::max(20, old_label_y) + 22 ); damage(4, (int) rint(center_x + x() + cur_mountain->x - 2*CROSS_SIZE - 1), (int) rint(center_y + y() + cur_mountain->y + cur_mountain->label_y - 2*CROSS_SIZE - 20), - MAX(20, cur_mountain->label_x) + 2*CROSS_SIZE + 2, - MAX(20, cur_mountain->label_y) + 22 ); + std::max(20, cur_mountain->label_x) + 2*CROSS_SIZE + 2, + std::max(20, cur_mountain->label_y) + 22 ); return 0; } @@ -660,7 +657,7 @@ int GipfelWidget::get_rel_track_width(Hill *m) { double dist = pan->get_real_distance(m); - return (int) rint(MAX((pan->get_scale()*track_width)/(dist*10.0), 1.0)); + return (int) rint(std::max((pan->get_scale()*track_width)/(dist*10.0), 1.0)); } void |