-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/actions/pan.c b/src/controller/actions/pan.c index 2f856b0..52e5fc1 100644 --- a/src/controller/actions/pan.c +++ b/src/controller/actions/pan.c | |||
@@ -10,10 +10,10 @@ pan (int x1, int y1, int x2, int y2) | |||
10 | { | 10 | { |
11 | int dx = x1 - x2; | 11 | int dx = x1 - x2; |
12 | int dy = y1 - x2; | 12 | int dy = y1 - x2; |
13 | 13 | ||
14 | if (dx == 0 && dy == 0) | 14 | if (dx == 0 && dy == 0) |
15 | return; | 15 | return; |
16 | 16 | ||
17 | /* | 17 | /* |
18 | * Convert the selection boundary from window coordinates to | 18 | * Convert the selection boundary from window coordinates to |
19 | * world coordinates. | 19 | * world coordinates. |
@@ -26,9 +26,9 @@ pan (int x1, int y1, int x2, int y2) | |||
26 | glGetDoublev (GL_PROJECTION_MATRIX, projection); | 26 | glGetDoublev (GL_PROJECTION_MATRIX, projection); |
27 | GLint viewport[4]; | 27 | GLint viewport[4]; |
28 | glGetIntegerv (GL_VIEWPORT, viewport); | 28 | glGetIntegerv (GL_VIEWPORT, viewport); |
29 | 29 | ||
30 | check_error (__FILE__, __LINE__); | 30 | check_error (__FILE__, __LINE__); |
31 | 31 | ||
32 | GLdouble start_position[3]; | 32 | GLdouble start_position[3]; |
33 | gluUnProject (x1, | 33 | gluUnProject (x1, |
34 | y1, | 34 | y1, |
@@ -36,11 +36,10 @@ pan (int x1, int y1, int x2, int y2) | |||
36 | model, | 36 | model, |
37 | projection, | 37 | projection, |
38 | viewport, | 38 | viewport, |
39 | &start_position[0], | 39 | &start_position[0], &start_position[1], &start_position[2]); |
40 | &start_position[1], &start_position[2]); | 40 | |
41 | |||
42 | check_error (__FILE__, __LINE__); | 41 | check_error (__FILE__, __LINE__); |
43 | 42 | ||
44 | GLdouble end_position[3]; | 43 | GLdouble end_position[3]; |
45 | gluUnProject (x2, | 44 | gluUnProject (x2, |
46 | y2, | 45 | y2, |
@@ -49,13 +48,13 @@ pan (int x1, int y1, int x2, int y2) | |||
49 | projection, | 48 | projection, |
50 | viewport, | 49 | viewport, |
51 | &end_position[0], &end_position[1], &end_position[2]); | 50 | &end_position[0], &end_position[1], &end_position[2]); |
52 | 51 | ||
53 | check_error (__FILE__, __LINE__); | 52 | check_error (__FILE__, __LINE__); |
54 | 53 | ||
55 | S.pan.trans[0] += end_position[0] - start_position[0]; | 54 | S.pan.trans[0] += end_position[0] - start_position[0]; |
56 | S.pan.trans[1] -= end_position[1] - start_position[1]; | 55 | S.pan.trans[1] -= end_position[1] - start_position[1]; |
57 | 56 | ||
58 | glutPostRedisplay (); | 57 | glutPostRedisplay (); |
59 | 58 | ||
60 | return; | 59 | return; |
61 | } | 60 | } |