one other note: Benjamin Jessup wrote: > # Custom Hit Test Function to Replace FloatCanvas.HitTest > def HitTest(self, event, HitEvent): > if self.HitDict: > # check if there are any objects in the dict for this event > xy = event.GetPosition() > xy = self.PixelToWorld( xy ) > for key in self.HitDict.keys(): > for key2 in self.HitDict[key].keys(): > bb = self.HitDict[key][key2].BoundingBox > if xy[0] > bb[0,0] and xy[0] < bb[1,0] and xy[1] < > bb[1,1] and xy[1] > bb[0,1]:
you might want to use >=, etc. -- so if a point is on the line, it counts as a hit -- this depends on how your objects are scaled, etc, but it seems safer. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
