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/mouse.c b/src/controller/callbacks/mouse.c
index 34ff290..5f5be43 100644
--- a/src/controller/callbacks/mouse.c
+++ b/src/controller/callbacks/mouse.c
@@ -25,8 +25,8 @@ mouse (int button, int state, int x, int y)
{
// Deactive a panning event if one was happening.
S.pan.active = false;
-
- if (S.selection.active &&
+
+ if (S.selection.active &&
S.selection.purpose == ZOOM &&
glutGetModifiers () == GLUT_ACTIVE_CTRL)
{
@@ -35,7 +35,7 @@ mouse (int button, int state, int x, int y)
*/
if (x == S.selection.x || y == S.selection.y)
return;
-
+
/*
* Convert the selection boundary from window coordinates to
* world coordinates.
@@ -48,21 +48,21 @@ mouse (int button, int state, int x, int y)
glGetDoublev (GL_PROJECTION_MATRIX, projection);
GLint viewport[4];
glGetIntegerv (GL_VIEWPORT, viewport);
-
+
check_error (__FILE__, __LINE__);
-
+
GLdouble start_position[3];
gluUnProject (x,
- viewport[3] -y,
+ viewport[3] - y,
0,
model,
projection,
viewport,
&start_position[0],
&start_position[1], &start_position[2]);
-
+
check_error (__FILE__, __LINE__);
-
+
GLdouble end_position[3];
gluUnProject (S.selection.x,
viewport[3] - S.selection.y,
@@ -71,9 +71,9 @@ mouse (int button, int state, int x, int y)
projection,
viewport,
&end_position[0], &end_position[1], &end_position[2]);
-
+
check_error (__FILE__, __LINE__);
-
+
zoom (fmin (start_position[0], end_position[0]),
fmin (start_position[1], end_position[1]),
fmax (start_position[0], end_position[0]),
@@ -83,7 +83,7 @@ mouse (int button, int state, int x, int y)
/*
* Complete a selection if one was started and not cancelled.
*/
- if (S.selection.active &&
+ if (S.selection.active &&
S.selection.purpose == SET &&
glutGetModifiers () == GLUT_ACTIVE_CTRL)
{
@@ -161,9 +161,8 @@ mouse (int button, int state, int x, int y)
}
// Begin selection.
- if (button == GLUT_LEFT_BUTTON &&
- state == GLUT_DOWN &&
- glutGetModifiers () == GLUT_ACTIVE_CTRL)
+ if (button == GLUT_LEFT_BUTTON &&
+ state == GLUT_DOWN && glutGetModifiers () == GLUT_ACTIVE_CTRL)
{
S.selection.active = true;
S.selection.x = x;
@@ -172,8 +171,7 @@ mouse (int button, int state, int x, int y)
// Pan.
if (button == GLUT_LEFT_BUTTON &&
- state == GLUT_DOWN &&
- glutGetModifiers () != GLUT_ACTIVE_CTRL)
+ state == GLUT_DOWN && glutGetModifiers () != GLUT_ACTIVE_CTRL)
{
/*
* Detection of the first point in a panning event.

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.