summaryrefslogtreecommitdiff
path: root/src/Panorama.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Panorama.cxx')
-rw-r--r--src/Panorama.cxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index c8cb1dc..73bc003 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -508,8 +508,11 @@ Panorama::update_coordinates() {
for (int i=0; i<visible_mountains->get_num(); i++) {
m = visible_mountains->get(i);
+ double tmp_x, tmp_y;
- proj->set_coordinates(m, &parms);
+ proj->get_coordinates(m->a_view, m->a_nick, &parms, &tmp_x, &tmp_y);
+ m->x = (int) rint(tmp_x);
+ m->y = (int) rint(tmp_y);
}
}
@@ -586,3 +589,22 @@ Panorama::get_real_distance(Hill *m) {
return c;
}
+int
+Panorama::get_coordinates(double a_view, double a_nick, double *x, double *y) {
+ a_view = a_view - parms.a_center;
+
+ if (a_view > pi_d) {
+ a_view -= 2.0*pi_d;
+ } else if (a_view < -pi_d) {
+ a_view += 2.0*pi_d;
+ }
+
+ if (a_view > view_angle || a_view < - view_angle) {
+ return 1;
+ }
+
+ proj->get_coordinates(a_view, a_nick, &parms, x, y);
+
+ return 0;
+}
+