Skip to content

Commit

Permalink
[Bug fixed] Fixed type error in fillRect by converting float values t…
Browse files Browse the repository at this point in the history
…o int for compatibility with higher Python version
  • Loading branch information
CVHub520 committed Aug 1, 2024
1 parent d3459bb commit 71cfc30
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions anylabeling/views/labeling/widgets/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,28 +1205,28 @@ def paintEvent(self, event): # noqa: C901
fm = QtGui.QFontMetrics(p.font())
rect = fm.boundingRect(degrees)
p.fillRect(
rect.x() + center.x() - d,
rect.y() + center.y() + d,
rect.width(),
rect.height(),
int(rect.x() + center.x() - d),
int(rect.y() + center.y() + d),
int(rect.width()),
int(rect.height()),
QtGui.QColor("#FF9900"),
)
pen = QtGui.QPen(
QtGui.QColor("#FFFFFF"), 7, QtCore.Qt.SolidLine
)
p.setPen(pen)
p.drawText(
center.x() - d,
center.y() + d,
int(center.x() - d),
int(center.y() + d),
degrees,
)
else:
cp = QtGui.QPainterPath()
cp.addRect(
center.x() - d / 2,
center.y() - d / 2,
d,
d,
int(center.x() - d / 2),
int(center.y() - d / 2),
int(d),
int(d),
)
p.drawPath(cp)
p.fillPath(cp, QtGui.QColor(255, 153, 0, 255))
Expand Down

0 comments on commit 71cfc30

Please sign in to comment.