Index: trunk/MagicSoft/Cosy/catalog/Makefile
===================================================================
--- trunk/MagicSoft/Cosy/catalog/Makefile	(revision 7773)
+++ trunk/MagicSoft/Cosy/catalog/Makefile	(revision 7787)
@@ -20,5 +20,5 @@
 # @endcode 
 
-INCLUDES = -I. -I.. -I../base -I../slalib
+INCLUDES = -I. -I.. -I../base -I../slalib -I../mars
 
 # @code 
Index: trunk/MagicSoft/Cosy/catalog/StarCatalog.cc
===================================================================
--- trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 7773)
+++ trunk/MagicSoft/Cosy/catalog/StarCatalog.cc	(revision 7787)
@@ -169,13 +169,8 @@
     // CalcStars flips the picture in X defaultwise now
     // This defined the box in which stars are really returned
-    int x0 = (768-xc)-box;
-    int x1 = (768-xc)+box;
-    int y0 = yc-box;
-    int y1 = yc+box;
-
-    if (x0<  -offset) x0=  -offset;
-    if (y0<  -offset) y0=  -offset;
-    if (x1>fW+offset) x1=fW+offset;
-    if (y1>fH+offset) y1=fH+offset;
+    const int x0 = TMath::Max((768-xc)-box,   -offset);
+    const int y0 = TMath::Max(yc-box,         -offset);
+    const int x1 = TMath::Min((768-xc)+box, fW+offset);
+    const int y1 = TMath::Min(yc+box,       fH+offset);
 
     // Align stars into telescope system
