From 92c9ab01cbe24a1b47a4cb767fe4c88438bfc0f5 Mon Sep 17 00:00:00 2001 From: zhiyiYo <1319158137@qq.com> Date: Sun, 13 Aug 2023 15:40:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=B4=E5=83=8F=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/avatar_widget/demo.py | 2 +- qfluentwidgets/components/widgets/label.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/avatar_widget/demo.py b/examples/avatar_widget/demo.py index 5f522e5..5ab6fd0 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 aa608e6..13bf6a9 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() -- GitLab