@@ -518,7 +518,7 @@ def calculateOffsets(self, shape, point):
518518 y1 = rect .y () - point .y ()
519519 x2 = (rect .x () + rect .width () - 1 ) - point .x ()
520520 y2 = (rect .y () + rect .height () - 1 ) - point .y ()
521- self .offsets = QtCore .QPoint (x1 , y1 ), QtCore .QPoint (x2 , y2 )
521+ self .offsets = QtCore .QPointF (x1 , y1 ), QtCore .QPointF (x2 , y2 )
522522
523523 def boundedMoveVertex (self , pos ):
524524 index , shape = self .hVertex , self .hShape
@@ -532,10 +532,10 @@ def boundedMoveShapes(self, shapes, pos):
532532 return False # No need to move
533533 o1 = pos + self .offsets [0 ]
534534 if self .outOfPixmap (o1 ):
535- pos -= QtCore .QPoint (min (0 , o1 .x ()), min (0 , o1 .y ()))
535+ pos -= QtCore .QPointF (min (0 , o1 .x ()), min (0 , o1 .y ()))
536536 o2 = pos + self .offsets [1 ]
537537 if self .outOfPixmap (o2 ):
538- pos += QtCore .QPoint (min (0 , self .pixmap .width () - o2 .x ()),
538+ pos += QtCore .QPointF (min (0 , self .pixmap .width () - o2 .x ()),
539539 min (0 , self .pixmap .height () - o2 .y ()))
540540 # XXX: The next line tracks the new position of the cursor
541541 # relative to the shape, but also results in making it
@@ -610,7 +610,7 @@ def boundedShiftShapes(self, shapes):
610610 # Try to move in one direction, and if it fails in another.
611611 # Give up if both fail.
612612 point = shapes [0 ][0 ]
613- offset = QtCore .QPoint (2.0 , 2.0 )
613+ offset = QtCore .QPointF (2.0 , 2.0 )
614614 self .offsets = QtCore .QPoint (), QtCore .QPoint ()
615615 self .prevPoint = point
616616 if not self .boundedMoveShapes (shapes , point - offset ):
@@ -688,7 +688,7 @@ def offsetToCenter(self):
688688 aw , ah = area .width (), area .height ()
689689 x = (aw - w ) / (2 * s ) if aw > w else 0
690690 y = (ah - h ) / (2 * s ) if ah > h else 0
691- return QtCore .QPoint (x , y )
691+ return QtCore .QPointF (x , y )
692692
693693 def outOfPixmap (self , p ):
694694 w , h = self .pixmap .width (), self .pixmap .height ()
@@ -732,10 +732,10 @@ def intersectionPoint(self, p1, p2):
732732 if (x , y ) == (x1 , y1 ):
733733 # Handle cases where previous point is on one of the edges.
734734 if x3 == x4 :
735- return QtCore .QPoint (x3 , min (max (0 , y2 ), max (y3 , y4 )))
735+ return QtCore .QPointF (x3 , min (max (0 , y2 ), max (y3 , y4 )))
736736 else : # y3 == y4
737- return QtCore .QPoint (min (max (0 , x2 ), max (x3 , x4 )), y3 )
738- return QtCore .QPoint (x , y )
737+ return QtCore .QPointF (min (max (0 , x2 ), max (x3 , x4 )), y3 )
738+ return QtCore .QPointF (x , y )
739739
740740 def intersectingEdges (self , point1 , point2 , points ):
741741 """Find intersecting edges.
@@ -762,8 +762,8 @@ def intersectingEdges(self, point1, point2, points):
762762 if 0 <= ua <= 1 and 0 <= ub <= 1 :
763763 x = x1 + ua * (x2 - x1 )
764764 y = y1 + ua * (y2 - y1 )
765- m = QtCore .QPoint ((x3 + x4 ) / 2 , (y3 + y4 ) / 2 )
766- d = labelme .utils .distance (m - QtCore .QPoint (x2 , y2 ))
765+ m = QtCore .QPointF ((x3 + x4 ) / 2 , (y3 + y4 ) / 2 )
766+ d = labelme .utils .distance (m - QtCore .QPointF (x2 , y2 ))
767767 yield d , i , (x , y )
768768
769769 # These two, along with a call to adjustSize are required for the
0 commit comments