1 /* 2 * resizemapobject.h 3 * Copyright 2009, Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> 4 * 5 * This file is part of Tiled. 6 * 7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the Free 9 * Software Foundation; either version 2 of the License, or (at your option) 10 * any later version. 11 * 12 * This program is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 15 * more details. 16 * 17 * You should have received a copy of the GNU General Public License along with 18 * this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 #pragma once 22 23 #include <QUndoCommand> 24 #include <QSizeF> 25 26 namespace Tiled { 27 28 class MapObject; 29 30 class Document; 31 32 class ResizeMapObject : public QUndoCommand 33 { 34 public: 35 ResizeMapObject(Document *document, 36 MapObject *mapObject, 37 const QSizeF &oldSize); 38 39 ResizeMapObject(Document *document, 40 MapObject *mapObject, 41 const QSizeF &newSize, 42 const QSizeF &oldSize); 43 44 void undo() override; 45 void redo() override; 46 47 private: 48 Document *mDocument; 49 MapObject *mMapObject; 50 QSizeF mOldSize; 51 QSizeF mNewSize; 52 bool mOldChangeState; 53 }; 54 55 } // namespace Tiled 56