Skip to content

Commit 94d0664

Browse files
authored
Fix editor background jump (#2182)
1 parent 2f7c15b commit 94d0664

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/editor/editor.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Editor::is_active()
8080
return true;
8181
} else {
8282
auto* self = Editor::current();
83-
return self && !self->m_leveltested;
83+
return self && !self->m_leveltested && self->m_after_setup;
8484
}
8585
}
8686

@@ -105,6 +105,7 @@ Editor::Editor() :
105105
m_sector(),
106106
m_levelloaded(false),
107107
m_leveltested(false),
108+
m_after_setup(false),
108109
m_tileset(nullptr),
109110
m_widgets(),
110111
m_overlay_widget(),
@@ -615,13 +616,15 @@ Editor::leave()
615616
{
616617
MouseCursor::current()->set_icon(nullptr);
617618
Compositor::s_render_lighting = true;
619+
m_after_setup = false;
618620
}
619621

620622
void
621623
Editor::setup()
622624
{
623625
Tile::draw_editor_images = true;
624626
Sector::s_draw_solids_only = false;
627+
m_after_setup = true;
625628
if (!m_levelloaded) {
626629

627630
#if 0

src/editor/editor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class Editor final : public Screen,
198198

199199
bool m_levelloaded;
200200
bool m_leveltested;
201+
bool m_after_setup; // Set to true after setup function finishes and to false after leave function finishes
201202

202203
TileSet* m_tileset;
203204

0 commit comments

Comments
 (0)