Dans l'editeur d'elements, les changements de dimensions et de point de saisie sont desormais annulables

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@119 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet
2007-09-10 21:12:49 +00:00
parent 2e3afaa13d
commit b1ea7d6249
5 changed files with 129 additions and 12 deletions

View File

@@ -134,4 +134,38 @@ class ChangePolygonPointsCommand : public QUndoCommand {
/// nouveaux points
QVector<QPointF> new_points;
};
/**
Cette classe represente l'action de modifier les dimensions et le point de saisie d'un element
*/
class ChangeHotspotCommand : public QUndoCommand {
// constructeurs, destructeur
public:
ChangeHotspotCommand(ElementScene *, const QSize &, const QSize &, const QPoint &, const QPoint &, const QPoint & = QPoint(), QUndoCommand * = 0);
virtual ~ChangeHotspotCommand();
private:
ChangeHotspotCommand(const ChangeHotspotCommand &);
// methodes
public:
virtual void undo();
virtual void redo();
private:
void applyOffset(const QPointF &);
// attributs
/// Element edite auquel il faut appliquer les modifications
ElementScene *element;
/// dimensions avant l'action
QSize size_before;
/// dimensions apres l'action
QSize size_after;
/// point de saisie avant l'action
QPoint hotspot_before;
/// point de saisie apres l'action
QPoint hotspot_after;
/// decalage a appliquer aux elements
QPoint offset;
};
#endif