summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.H3
-rw-r--r--src/GipfelWidget.cxx22
2 files changed, 10 insertions, 15 deletions
diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H
index 838f290..d475a80 100644
--- a/src/GipfelWidget.H
+++ b/src/GipfelWidget.H
@@ -48,6 +48,8 @@ class GipfelWidget : public Fl_Widget {
static int get_pixel(Fl_Image *img, int x, int y,
int *r, int *g, int *b);
+ static void center_cb(Fl_Widget *o, void *f);
+
public:
typedef enum {
NEAREST = 0,
@@ -56,7 +58,6 @@ class GipfelWidget : public Fl_Widget {
GipfelWidget(int X,int Y,int W, int H);
- void center();
int load_image(char *file);
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index b7a9c54..7586a7f 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -32,8 +32,6 @@
static double pi_d, deg2rad;
-static void center_cb(Fl_Widget *o, void *f);
-
GipfelWidget::GipfelWidget(int X,int Y,int W, int H): Fl_Widget(X, Y, W, H) {
pi_d = asin(1.0) * 2.0;
deg2rad = pi_d / 180.0;
@@ -571,23 +569,19 @@ GipfelWidget::get_view_height() {
}
void
-GipfelWidget::center() {
- Hill *m = choose_hill(pan->get_close_mountains(), "Center Peak");
+GipfelWidget::center_cb(Fl_Widget *o, void *f) {
+ GipfelWidget *g = (GipfelWidget*) f;
+
+ Hill *m = choose_hill(g->pan->get_close_mountains(), "Center Peak");
if (m) {
- set_center_angle(m->alph / deg2rad);
+ g->set_center_angle(m->alph / deg2rad);
- if (!known_hills->contains(m)) {
- known_hills->add(m);
+ if (!g->known_hills->contains(m)) {
+ g->known_hills->add(m);
}
-
}
}
-static void
-center_cb(Fl_Widget *o, void *f) {
- ((GipfelWidget*)f)->center();
-}
-
void
GipfelWidget::set_height_dist_ratio(double r) {
pan->set_height_dist_ratio(r);
@@ -610,8 +604,8 @@ GipfelWidget::set_show_hidden(int h) {
set_labels(pan->get_visible_mountains());
redraw();
-
}
+
void
GipfelWidget::set_view_lat(double v) {
pan->set_view_lat(v);