From 87b8c6bd3a00b6697da9e919475e322cb311fe35 Mon Sep 17 00:00:00 2001 From: evgeny Date: Tue, 6 Oct 2026 19:42:22 +0200 Subject: [PATCH] Use exact image coordinates in the desktop crop editor --- tools/chatgui/src/avatars/avatarcrop.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/chatgui/src/avatars/avatarcrop.cpp b/tools/chatgui/src/avatars/avatarcrop.cpp index d96e9040..613630e9 100644 --- a/tools/chatgui/src/avatars/avatarcrop.cpp +++ b/tools/chatgui/src/avatars/avatarcrop.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,7 @@ public: } QRectF selection() const { const double s = scale(); - const QPointF top = rect().center() + offset - QPointF(image.width()*s/2, image.height()*s/2); + const QPointF top = QPointF(width()/2.0,height()/2.0) + offset - QPointF(image.width()*s/2, image.height()*s/2); const QRectF f = frame(); return {(f.x()-top.x())/s/image.width(), (f.y()-top.y())/s/image.height(), f.width()/s/image.width(), f.height()/s/image.height()}; }