Element primitive decorator : the handlers keep the same size at screen, no matter the zoom

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4052 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-07-16 14:58:01 +00:00
parent 3291737cab
commit ca37f384fb
2 changed files with 75 additions and 153 deletions

View File

@@ -17,8 +17,11 @@
*/
#ifndef ELEMENTPRIMITIVEDECORATOR_H
#define ELEMENTPRIMITIVEDECORATOR_H
#include <QGraphicsObject>
#include "qet.h"
#include "QetGraphicsItemModeler/qetgraphicshandlerutility.h"
class ElementEditionCommand;
class ElementScene;
class CustomElementPart;
@@ -34,7 +37,8 @@ class CustomElementPart;
- the new bounding rect, after the user moved or resized items
- the former bounding rect, due to implementation details
*/
class ElementPrimitiveDecorator : public QGraphicsObject {
class ElementPrimitiveDecorator : public QGraphicsObject
{
Q_OBJECT
public:
@@ -83,12 +87,7 @@ class ElementPrimitiveDecorator : public QGraphicsObject {
void translateItems(const QPointF &);
void scaleItems(const QRectF &, const QRectF &);
QRectF getSceneBoundingRect(QGraphicsItem *) const;
void drawSquares(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
void drawResizeSquare(QPainter *, const QStyleOptionGraphicsItem *, QWidget *, const QRectF &);
void drawGenericSquare(QPainter *, const QStyleOptionGraphicsItem *, QWidget *, const QRectF &, const QColor &, const QColor &);
QList<QRectF> getResizingSquares();
QRectF getGenericSquare(const QPointF &);
int resizingSquareAtPos(const QPointF &);
QVector <QPointF> getResizingsPoints() const;
// attributes
private:
@@ -109,6 +108,7 @@ class ElementPrimitiveDecorator : public QGraphicsObject {
QPointF mouse_offset_; ///< Offset between the mouse position and the point to be snapped to grid when moving selection
bool moving_by_keys_; ///< Whether we are currently moving our decorated items using the arrow keys
QPointF keys_movement_; ///< Movement applied to our decorated items using the arrow keys
QetGraphicsHandlerUtility m_handler;
};
#endif