-rw-r--r-- | Makefile.am | 17 | ||||
-rw-r--r-- | src/controller/actions/pan.c | 23 | ||||
-rw-r--r-- | src/controller/actions/set_ortho.c | 5 | ||||
-rw-r--r-- | src/controller/actions/zoom.c | 8 | ||||
-rw-r--r-- | src/controller/callbacks/keyboard.c | 2 | ||||
-rw-r--r-- | src/controller/callbacks/mouse.c | 30 | ||||
-rw-r--r-- | src/controller/callbacks/mouse_motion.c | 2 | ||||
-rw-r--r-- | src/controller/callbacks/mouse_wheel.c | 8 | ||||
-rw-r--r-- | src/controller/callbacks/reshape.c | 26 | ||||
-rw-r--r-- | src/model/geometry/map_geometry.c | 10 | ||||
-rw-r--r-- | src/model/state/pan_info_init.h | 2 | ||||
-rw-r--r-- | src/model/state/zoom_info_init.c | 2 |
12 files changed, 70 insertions, 65 deletions
diff --git a/src/controller/callbacks/reshape.c b/src/controller/callbacks/reshape.c index fec5443..0414be6 100644 --- a/src/controller/callbacks/reshape.c +++ b/src/controller/callbacks/reshape.c @@ -21,23 +21,25 @@ reshape (int w, int h) { if (w >= h) { - double scale - = ( ( (S.zoom.coords[1] - S.zoom.coords[0]) * ((double) w / (double) h) ) - - (S.zoom.coords[1] - S.zoom.coords[0]) ) - * 0.5; + double scale + = + (((S.zoom.coords[1] - + S.zoom.coords[0]) * ((double) w / (double) h)) - + (S.zoom.coords[1] - S.zoom.coords[0])) * 0.5; S.ortho.min_x = S.zoom.coords[0] - scale; - S.ortho.max_x = S.zoom.coords[1] + scale; + S.ortho.max_x = S.zoom.coords[1] + scale; S.ortho.min_y = S.zoom.coords[2]; S.ortho.max_y = S.zoom.coords[3]; } else { - double scale - = ( ( (S.zoom.coords[3] - S.zoom.coords[2]) * ((double) h / (double) w) ) - - (S.zoom.coords[3] - S.zoom.coords[2]) ) - * 0.5; - + double scale + = + (((S.zoom.coords[3] - + S.zoom.coords[2]) * ((double) h / (double) w)) - + (S.zoom.coords[3] - S.zoom.coords[2])) * 0.5; + S.ortho.min_x = S.zoom.coords[0]; S.ortho.max_x = S.zoom.coords[1]; S.ortho.min_y = S.zoom.coords[2] - scale; @@ -45,7 +47,7 @@ reshape (int w, int h) } } - else + else { /* * This scaling produces an odd effect when the coordinates are @@ -68,7 +70,7 @@ reshape (int w, int h) S.ortho.min_y = S.ortho_min; S.ortho.max_y = S.ortho_max; } - } + } set_ortho (); |