summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/GipfelWidget.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index ca7d7f8..19be5ae 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -245,6 +245,9 @@ GipfelWidget::draw() {
known_hills->contains(m) || m == focused_mountain)
continue;
+ if (fabs(m->x) > img->w() / 2 || fabs(m->y) > img->h() / 2)
+ continue;
+
fl_xyline(m_x - CROSS_SIZE, m_y, m_x + CROSS_SIZE);
fl_yxline(m_x, m_y + m->label_y - height, m_y + CROSS_SIZE);
fl_xyline(m_x, m_y + m->label_y - height, m_x + m->label_x);
@@ -259,6 +262,9 @@ GipfelWidget::draw() {
(!show_hidden && (m->flags & Hill::HIDDEN)) || m == focused_mountain)
continue;
+ if (fabs(m->x) > img->w() / 2 || fabs(m->y) > img->h() / 2)
+ continue;
+
if (known_hills->contains(m)) {
if (known_hills->get_num() > 3)
fl_color(FL_GREEN);
@@ -348,6 +354,9 @@ GipfelWidget::set_labels(Hills *v) {
if (!show_hidden && (m->flags & Hill::HIDDEN))
continue;
+ if (fabs(m->x) > img->w() / 2 || fabs(m->y) > img->h() / 2)
+ continue;
+
m->label_x = (int) fl_width(m->name) + 1;
m->label_y = 0;
@@ -360,6 +369,9 @@ GipfelWidget::set_labels(Hills *v) {
if (!show_hidden && (n->flags & Hill::HIDDEN))
continue;
+ if (fabs(m->x) > img->w() / 2 || fabs(m->y) > img->h() / 2)
+ continue;
+
if (overlap(m->x, m->label_x, n->x - CROSS_SIZE, n->label_x))
colliding.add(n);
else