When the editor's current sprite is set we have to drop the pixels (if the user is moving pixels).

This commit is contained in:
David Capello 2010-08-11 22:04:18 -03:00
parent 7b272f86f7
commit f8cd32d07b

View File

@ -131,8 +131,12 @@ void Editor::editor_set_sprite(Sprite* sprite)
if (this->hasMouse())
jmanager_free_mouse(); // TODO Why is this here? Review this code
// The editor must be stand-by state
ASSERT(m_state == EDITOR_STATE_STANDBY);
// Do we need to drop files?
if (m_pixelsMovement)
dropPixels();
ASSERT(m_pixelsMovement == NULL && "You cannot change the current sprite while you are moving pixels");
ASSERT(m_state == EDITOR_STATE_STANDBY && "You can change the current sprite only in stand-by state");
// Change the sprite
m_sprite = sprite;