[grits] Check the roam view before unprojecting



commit 74a55fb8afe07234c705513d324c6cc373e18f8a
Author: Andy Spencer <andy753421 gmail com>
Date:   Thu Feb 16 21:24:14 2012 +0000

    Check the roam view before unprojecting
    
    On win32 (and maybe others) the motion notify callback can occur before
    the roam view is properly initialized.

 src/grits-opengl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/grits-opengl.c b/src/grits-opengl.c
index 1b2cce9..0b4100a 100644
--- a/src/grits-opengl.c
+++ b/src/grits-opengl.c
@@ -469,6 +469,8 @@ static void grits_opengl_unproject(GritsViewer *_opengl,
 		gdouble *lat, gdouble *lon, gdouble *elev)
 {
 	GritsOpenGL *opengl = GRITS_OPENGL(_opengl);
+	if (!opengl->sphere->view)
+		return;
 	gdouble x, y, z;
 	if (pz < 0) {
 		gfloat tmp = 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]