ab923da8deeb3fc3bd5d04fa84e36090c6bcb129
tdreszer
  Tue Apr 22 16:47:33 2014 -0700
Added a trap for when map items are written outside the track they are supposed to be for.  The trap is only on for genome-test and sandboxes.  I found one bug with it: gold in dense had wild map item ending coordinates.  Fixed.  Redmine #13087
diff --git src/hg/hgTracks/imageV2.h src/hg/hgTracks/imageV2.h
index 6d3cf2c..07155c7 100644
--- src/hg/hgTracks/imageV2.h
+++ src/hg/hgTracks/imageV2.h
@@ -340,30 +340,38 @@
 
 struct imgSlice *imgTrackSliceGetByType(struct imgTrack *imgTrack,enum sliceType type);
 // Gets a specific slice already added to an image track.
 // Expected are types: stData, stButton, stSide and stCenter
 
 struct imgSlice *imgTrackSliceFindOrAdd(struct imgTrack *imgTrack,enum sliceType type,
                                         struct image *img,char *title,int width,int height,
                                         int offsetX,int offsetY);
 // Find the slice or adds it
 
 struct imgSlice *imgTrackSliceUpdateOrAdd(struct imgTrack *imgTrack,enum sliceType type,
                                           struct image *img,char *title,int width,int height,
                                           int offsetX,int offsetY);
 // Updates the slice or adds it
 
+int imgTrackCoordinates(struct imgTrack *imgTrack, int *leftX,int *topY,int *rightX,int *bottomY);
+// Fills in topLeft x,y and bottomRight x,y coordinates, returning topY.
+#define imgTrackTopY(imgTrack) imgTrackCoordinates(imgTrack,NULL,NULL,NULL,NULL)
+// Returns the Y coordinate of the top of the track.
+
+int imgTrackBottomY(struct imgTrack *imgTrack);
+// Returns the Y coordinate of the bottom of the track.
+
 struct mapSet *imgTrackGetMapByType(struct imgTrack *imgTrack,enum sliceType type);
 // Gets the map assocated with a specific slice belonging to the imgTrack
 
 int imgTrackAddMapItem(struct imgTrack *imgTrack,char *link,char *title,int topLeftX,int topLeftY,
                        int bottomRightX,int bottomRightY, char *id);
 // Will add a map item it an imgTrack's appropriate slice's map
 // Since a map item may span slices, the imgTrack is in the best position to determine where
 // to put the map item.
 // Returns count of map items added, which could be 0, 1 or more than one if item spans slices
 // NOTE: Precedence is given to first map item when adding items with same coordinates!
 
 boolean imgTrackIsComplete(struct imgTrack *imgTrack,boolean verbose);
 // Tests the completeness and consistency of this imgTrack (including slices)
 
 void imgTrackFree(struct imgTrack **pImgTrack);