def _pixelHover(self, event): if Selection.getFaceSelectMode(): face_id = self._selection_pass.getFaceIdAtPosition(event.x, event.y) if face_id >= 0: Selection.hoverFace(Selection.getSelectedObject(0), face_id) else: Selection.clearFace() return True return False
def test_hoverFace(self): Selection.hoverFaceChanged = MagicMock() node_1 = SceneNode() assert Selection.getHoverFace() is None Selection.hoverFace(node_1, 81) Selection.hoverFace(node_1, 81) assert Selection.getHoverFace() == (node_1, 81) assert Selection.hoverFaceChanged.emit.call_count == 1 Selection.unhoverFace() assert Selection.getHoverFace() is None Selection.hoverFace(node_1, 82) Selection.hoverFace(node_1, 83) assert Selection.hoverFaceChanged.emit.call_count == 4 Selection.clearFace() assert Selection.getHoverFace() is None assert Selection.hoverFaceChanged.emit.call_count == 5