Skip to content
Snippets Groups Projects
Commit d0983dca authored by Kentaro Wada's avatar Kentaro Wada
Browse files

Use QPointF to avoid TypeError in Python3.10

Close #1203
parent ef2cbd46
Branches master
No related tags found
No related merge requests found
...@@ -699,10 +699,10 @@ class Canvas(QtWidgets.QWidget): ...@@ -699,10 +699,10 @@ class Canvas(QtWidgets.QWidget):
if (x, y) == (x1, y1): if (x, y) == (x1, y1):
# Handle cases where previous point is on one of the edges. # Handle cases where previous point is on one of the edges.
if x3 == x4: if x3 == x4:
return QtCore.QPoint(x3, min(max(0, y2), max(y3, y4))) return QtCore.QPointF(x3, min(max(0, y2), max(y3, y4)))
else: # y3 == y4 else: # y3 == y4
return QtCore.QPoint(min(max(0, x2), max(x3, x4)), y3) return QtCore.QPointF(min(max(0, x2), max(x3, x4)), y3)
return QtCore.QPoint(x, y) return QtCore.QPointF(x, y)
def intersectingEdges(self, point1, point2, points): def intersectingEdges(self, point1, point2, points):
"""Find intersecting edges. """Find intersecting edges.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment