mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-01-24 17:26:41 +00:00
fix some editor crashes when switching edit modes while dragging a thing
This commit is contained in:
parent
03eeb7f4e9
commit
3972983c72
2 changed files with 6 additions and 3 deletions
|
@ -251,7 +251,7 @@ public:
|
||||||
void removePath(size_t idx);
|
void removePath(size_t idx);
|
||||||
void clearPaths();
|
void clearPaths();
|
||||||
size_t getNumPaths() const {return paths.size();}
|
size_t getNumPaths() const {return paths.size();}
|
||||||
Path *getPath(size_t idx) const {return paths[idx];}
|
Path *getPath(size_t idx) const {return idx < paths.size() ? paths[idx] : NULL;}
|
||||||
Path *getFirstPathOfType(PathType type) const {return firstPathOfType[type];}
|
Path *getFirstPathOfType(PathType type) const {return firstPathOfType[type];}
|
||||||
Path *getPathByName(std::string name);
|
Path *getPathByName(std::string name);
|
||||||
size_t getIndexOfPath(Path *p);
|
size_t getIndexOfPath(Path *p);
|
||||||
|
|
|
@ -291,7 +291,7 @@ void SceneEditor::setBackgroundGradient()
|
||||||
|
|
||||||
void SceneEditor::updateSelectedElementPosition(Vector dist)
|
void SceneEditor::updateSelectedElementPosition(Vector dist)
|
||||||
{
|
{
|
||||||
if (state == ES_MOVING)
|
if (state == ES_MOVING && multi)
|
||||||
{
|
{
|
||||||
// the actual tile position is updated when we release the mouse
|
// the actual tile position is updated when we release the mouse
|
||||||
multi->position = oldPosition + dist;
|
multi->position = oldPosition + dist;
|
||||||
|
@ -2621,7 +2621,10 @@ void SceneEditor::update(float dt)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ES_MOVING:
|
case ES_MOVING:
|
||||||
game->getPath(selectedIdx)->nodes[selectedNode].position = dsq->getGameCursorPosition() + cursorOffset;
|
{
|
||||||
|
if(Path *p = game->getPath(selectedIdx))
|
||||||
|
p->nodes[selectedNode].position = dsq->getGameCursorPosition() + cursorOffset;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ES_ROTATING:
|
case ES_ROTATING:
|
||||||
case ES_MAX:
|
case ES_MAX:
|
||||||
|
|
Loading…
Reference in a new issue