MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / HitTest

Method HitTest

gui/builtinShipBrowser/raceSelector.py:142–154  ·  view source on GitHub ↗
(self, mx, my)

Source from the content-addressed store, hash-verified

140 event.Skip()
141
142 def HitTest(self, mx, my):
143 x, y = self.buttonsBarPos
144 padding = self.buttonsPadding
145
146 for bmp in self.raceBmps:
147 if (x < mx < x + bmp.GetWidth()) and (y < my < y + bmp.GetHeight()):
148 return self.raceBmps.index(bmp)
149 if self.layout == wx.VERTICAL:
150 y += bmp.GetHeight() + padding
151 else:
152 x += bmp.GetWidth() + padding
153
154 return None
155
156 def RebuildRaces(self, races):
157 self.raceBmps = []

Callers 2

OnMouseMoveMethod · 0.95
OnLeftUpMethod · 0.95

Calls 2

GetWidthMethod · 0.45
GetHeightMethod · 0.45

Tested by

no test coverage detected