|
|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
#include <QLabel> |
|
|
|
|
#include <QMouseEvent> |
|
|
|
|
#include <QPainter> |
|
|
|
|
#include <QPainterPath> |
|
|
|
|
#include <QPointer> |
|
|
|
|
#include <QPushButton> |
|
|
|
|
#include <QRunnable> |
|
|
|
|
@ -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()}; |
|
|
|
|
} |
|
|
|
|
|