def mousePressEvent(self, event):
if self.isPanning or self.isRotating:
self.setCursor(Qt.ClosedHandCursor)
elif event.button() == Qt.LeftButton:
clicked, offset, tol = self.getClickedDetails(event)
xyForZ = {}
for shape in self.shapes:
hit = False
z = shape.axis3_start_mill_depth
if z not in xyForZ:
xyForZ[z] = self.determineSelectedPosition(clicked, z, offset)
hit |= shape.isHit(xyForZ[z], tol)
if not hit:
z = shape.axis3_mill_depth
if z not in xyForZ:
xyForZ[z] = self.determineSelectedPosition(clicked, z, offset)
hit |= shape.isHit(xyForZ[z], tol)
if self.isMultiSelect and shape.selected:
hit = not hit
if hit != shape.selected:
g.window.TreeHandler.updateShapeSelection(shape, hit)
shape.selected = hit
self.update()
self._lastPos = event.pos()
评论列表
文章目录