Index: trunk/Ohana/src/libdvo/src/dbCmdlineFields.c
===================================================================
--- trunk/Ohana/src/libdvo/src/dbCmdlineFields.c	(revision 40571)
+++ trunk/Ohana/src/libdvo/src/dbCmdlineFields.c	(revision 40574)
@@ -125,5 +125,5 @@
   // get the ra,dec limits...
   if (selection->useDisplay) {
-    return (TRUE);
+    // return (TRUE);
     // XXX fix this: be more careful with the projection & limits
 
@@ -134,9 +134,21 @@
     }
     
+    double Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax));
+    Dmin = graphsky.coords.crval2 - Radius;
+    Dmax = graphsky.coords.crval2 + Radius;
+    
+    if ((Dmin <= -89) || (Dmax >= 89)) {
+      Rmin = 0;
+      Rmax = 360;
+    } else {
+      double Rmod = MAX (Radius / (cos(Dmin*RAD_DEG)), Radius / (cos(Dmax*RAD_DEG)));
+      Rmin = graphsky.coords.crval1 - Rmod;
+      Rmax = graphsky.coords.crval1 + Rmod;
+    }
     // XXX the ra and dec range depend on the projection. 
     // XXX this is wrong...
     // int status;
-    XY_to_RD (&Rmin, &Dmin, graphsky.xmin, graphsky.ymin, &graphsky.coords);
-    XY_to_RD (&Rmax, &Dmax, graphsky.xmax, graphsky.ymax, &graphsky.coords);
+    // XY_to_RD (&Rmin, &Dmin, graphsky.xmin, graphsky.ymin, &graphsky.coords);
+    // XY_to_RD (&Rmax, &Dmax, graphsky.xmax, graphsky.ymax, &graphsky.coords);
   }
 
