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 undo() override;
|
||||||
void redo() 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; }
|
int id() const override { return CommandId::ID_ScriptEditMap; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -498,10 +498,10 @@ ScriptEditMap::ScriptEditMap(Map *map,
|
||||||
this->newMetatiles = newMetatiles;
|
this->newMetatiles = newMetatiles;
|
||||||
this->oldMetatiles = oldMetatiles;
|
this->oldMetatiles = oldMetatiles;
|
||||||
|
|
||||||
this->oldMapWidth = oldMapWidth;
|
this->oldMapWidth = oldMapDimensions.width();
|
||||||
this->oldMapHeight = oldMapHeight;
|
this->oldMapHeight = oldMapDimensions.height();
|
||||||
this->newMapWidth = newMapWidth;
|
this->newMapWidth = newMapDimensions.width();
|
||||||
this->newMapHeight = newMapHeight;
|
this->newMapHeight = newMapDimensions.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptEditMap::~ScriptEditMap() {
|
ScriptEditMap::~ScriptEditMap() {
|
||||||
|
@ -517,7 +517,7 @@ void ScriptEditMap::redo() {
|
||||||
if (map->layout->blockdata) {
|
if (map->layout->blockdata) {
|
||||||
map->layout->blockdata->copyFrom(newMetatiles);
|
map->layout->blockdata->copyFrom(newMetatiles);
|
||||||
if (newMapWidth != map->getWidth() || newMapHeight != map->getHeight()) {
|
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) {
|
if (map->layout->blockdata) {
|
||||||
map->layout->blockdata->copyFrom(oldMetatiles);
|
map->layout->blockdata->copyFrom(oldMetatiles);
|
||||||
if (oldMapWidth != map->getWidth() || oldMapHeight != map->getHeight()) {
|
if (oldMapWidth != map->getWidth() || oldMapHeight != map->getHeight()) {
|
||||||
map->setDimensions(oldMapWidth, oldMapHeight);
|
map->setDimensions(oldMapWidth, oldMapHeight, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue