summaryrefslogtreecommitdiffstats
Side-by-side diff
-rw-r--r--Makefile.am17
-rw-r--r--src/controller/actions/pan.c23
-rw-r--r--src/controller/actions/set_ortho.c5
-rw-r--r--src/controller/actions/zoom.c8
-rw-r--r--src/controller/callbacks/keyboard.c2
-rw-r--r--src/controller/callbacks/mouse.c30
-rw-r--r--src/controller/callbacks/mouse_motion.c2
-rw-r--r--src/controller/callbacks/mouse_wheel.c8
-rw-r--r--src/controller/callbacks/reshape.c26
-rw-r--r--src/model/geometry/map_geometry.c10
-rw-r--r--src/model/state/pan_info_init.h2
-rw-r--r--src/model/state/zoom_info_init.c2
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 ();

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.