]> Pileus Git - grits/commitdiff
Check the roam view before unprojecting
authorAndy Spencer <andy753421@gmail.com>
Thu, 16 Feb 2012 21:24:14 +0000 (21:24 +0000)
committerAndy Spencer <andy753421@gmail.com>
Thu, 16 Feb 2012 21:27:02 +0000 (21:27 +0000)
On win32 (and maybe others) the motion notify callback can occur before
the roam view is properly initialized.

src/grits-opengl.c

index 1b2cce95e362c4fc6c08978f298a3b27b61e2b35..0b4100a8f48672401d471895b26df4649b40f848 100644 (file)
@@ -469,6 +469,8 @@ static void grits_opengl_unproject(GritsViewer *_opengl,
                gdouble *lat, gdouble *lon, gdouble *elev)
 {
        GritsOpenGL *opengl = GRITS_OPENGL(_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;
        gdouble x, y, z;
        if (pz < 0) {
                gfloat tmp = 0;