fix error in script edit command
This commit is contained in:
parent
24f970628e
commit
2a11760afd
2 changed files with 7 additions and 7 deletions
|
@ -345,7 +345,7 @@ public:
|
|||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
bool mergeWith(const QUndoCommand *) override { return false; };
|
||||
bool mergeWith(const QUndoCommand *) override { return false; }
|
||||
int id() const override { return CommandId::ID_ScriptEditMap; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -498,10 +498,10 @@ ScriptEditMap::ScriptEditMap(Map *map,
|
|||
this->newMetatiles = newMetatiles;
|
||||
this->oldMetatiles = oldMetatiles;
|
||||
|
||||
this->oldMapWidth = oldMapWidth;
|
||||
this->oldMapHeight = oldMapHeight;
|
||||
this->newMapWidth = newMapWidth;
|
||||
this->newMapHeight = newMapHeight;
|
||||
this->oldMapWidth = oldMapDimensions.width();
|
||||
this->oldMapHeight = oldMapDimensions.height();
|
||||
this->newMapWidth = newMapDimensions.width();
|
||||
this->newMapHeight = newMapDimensions.height();
|
||||
}
|
||||
|
||||
ScriptEditMap::~ScriptEditMap() {
|
||||
|
@ -517,7 +517,7 @@ void ScriptEditMap::redo() {
|
|||
if (map->layout->blockdata) {
|
||||
map->layout->blockdata->copyFrom(newMetatiles);
|
||||
if (newMapWidth != map->getWidth() || newMapHeight != map->getHeight()) {
|
||||
map->setDimensions(newMapWidth, newMapHeight);
|
||||
map->setDimensions(newMapWidth, newMapHeight, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -533,7 +533,7 @@ void ScriptEditMap::undo() {
|
|||
if (map->layout->blockdata) {
|
||||
map->layout->blockdata->copyFrom(oldMetatiles);
|
||||
if (oldMapWidth != map->getWidth() || oldMapHeight != map->getHeight()) {
|
||||
map->setDimensions(oldMapWidth, oldMapHeight);
|
||||
map->setDimensions(oldMapWidth, oldMapHeight, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue