diff --git a/examples/avatar_widget/demo.py b/examples/avatar_widget/demo.py index 5f522e5291b1b93289f35ac86eb14425ea81d28a..5ab6fd0b044ac00b35b0d6c70b23f82616c9ffdc 100644 --- a/examples/avatar_widget/demo.py +++ b/examples/avatar_widget/demo.py @@ -23,7 +23,7 @@ class Demo(QWidget): sizes = [96, 48, 32, 24] for s in sizes: w = AvatarWidget(avatar, self) - w.setRadius(s / 2) + w.setRadius(s // 2) self.hBoxLayout.addWidget(w) diff --git a/qfluentwidgets/components/widgets/label.py b/qfluentwidgets/components/widgets/label.py index aa608e6332ea9d27ae102b811e50590fac0b39da..13bf6a9bbf5d4db333d4615a78c06402ad52a8a2 100644 --- a/qfluentwidgets/components/widgets/label.py +++ b/qfluentwidgets/components/widgets/label.py @@ -382,7 +382,7 @@ class AvatarWidget(ImageLabel): iw, ih = image.width(), image.height() d = self.getRadius() * 2 * self.devicePixelRatioF() x, y = (iw - d) / 2, (ih - d) / 2 - image = image.copy(int(x), int(y), d, d) + image = image.copy(int(x), int(y), int(d), int(d)) # draw image path = QPainterPath()