diff --git a/src/widgets/editor/cursor.cpp b/src/widgets/editor/cursor.cpp index 22faecf34..dbea7809e 100644 --- a/src/widgets/editor/cursor.cpp +++ b/src/widgets/editor/cursor.cpp @@ -341,6 +341,8 @@ void Editor::editor_draw_cursor(int x, int y, bool refresh) void Editor::editor_move_cursor(int x, int y, bool refresh) { + ASSERT(m_sprite != NULL); + int old_screen_x = m_cursor_screen_x; int old_screen_y = m_cursor_screen_y; int old_x = m_cursor_editor_x; @@ -399,6 +401,7 @@ void Editor::editor_clean_cursor(bool refresh) int x, y; ASSERT(m_cursor_thick != 0); + ASSERT(m_sprite != NULL); clipping_region = jwidget_get_drawable_region(this, JI_GDR_CUTTOPWINDOWS); diff --git a/src/widgets/editor/editor.cpp b/src/widgets/editor/editor.cpp index 5c214efac..0f289d38a 100644 --- a/src/widgets/editor/editor.cpp +++ b/src/widgets/editor/editor.cpp @@ -141,6 +141,9 @@ void Editor::editor_set_sprite(Sprite* sprite) 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"); + if (m_cursor_thick) + editor_clean_cursor(); + // Change the sprite m_sprite = sprite; if (m_sprite) {