def point_in_area(self, p): """ Default hit test is to see if point is inside convex with points in order 0 - n. Override for different hit test. """ points = self.editpoints_as_tuples_list() return viewgeom.point_in_convex_polygon(p, points, 0)
def _check_shape_hit(self, x, y): edit_panel_points = [] for ep in self.edit_points: edit_panel_points.append(self.get_panel_point(*ep)) for i in range(0, 4): if self._check_point_hit((x, y), edit_panel_points[i], 10): return i #indexes correspond to edit_point_handle indexes if viewgeom.point_in_convex_polygon((x, y), edit_panel_points[3:7], 0) == True: # corners are edit points 3, 4, 5, 6 return AREA_HIT return NO_HIT
def _check_shape_hit(self, x, y): edit_panel_points = [] for ep in self.edit_points: edit_panel_points.append(self.get_panel_point(*ep)) for i in range(0, 4): if self._check_point_hit((x, y), edit_panel_points[i], 10): return i #indexes correspond to edit_point_handle indexes if viewgeom.point_in_convex_polygon( (x, y), edit_panel_points[3:7], 0) == True: # corners are edit points 3, 4, 5, 6 return AREA_HIT return NO_HIT