mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Fix a bug when calling Editor::editor_set_sprite(NULL).
The editor_clean_cursor() function is called from editor_set_scroll() when no sprite is selected.
This commit is contained in:
parent
24c2bf40e3
commit
b59b14444e
@ -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);
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user