]> git.localhorst.tv Git - blobs.git/commitdiff
call resize on state enter to init size
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 18 Dec 2017 14:33:50 +0000 (15:33 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Mon, 18 Dec 2017 14:33:50 +0000 (15:33 +0100)
src/app/app.cpp

index 950eda8cb3610c08e779ea478c578a68abc90c2b..8cd49f3e97b5488b7b59901ce94c51fe157ed2bf 100644 (file)
@@ -39,6 +39,7 @@ void Application::PushState(State *s) {
        ++s->ref_count;
        if (s->ref_count == 1) {
                s->OnEnter();
+               s->OnResize(viewport.Width(), viewport.Height());
        }
        s->OnResume();
 }
@@ -66,6 +67,7 @@ State *Application::SwitchState(State *s_new) {
        }
        if (s_new->ref_count == 1) {
                s_new->OnEnter();
+               s_new->OnResize(viewport.Width(), viewport.Height());
        }
        s_new->OnResume();
        return s_old;