@@ -157,20 +157,25 @@ function initGraphics(elm, Module) {
158 var currentScene = signalGraph.value;
158 var currentScene = signalGraph.value;
160− // Add the currentScene to the DOM
160+ // Add the currentScene to the DOM
161 var Render = ElmRuntime.use(ElmRuntime.Render.Element);
161 var Render = ElmRuntime.use(ElmRuntime.Render.Element);
162 elm.node.appendChild(Render.render(currentScene));
162 elm.node.appendChild(Render.render(currentScene));
163− if (elm.Native.Window) elm.Native.Window.resizeIfNeeded();
165 // set up updates so that the DOM is adjusted as necessary.
164 // set up updates so that the DOM is adjusted as necessary.
166 function domUpdate(newScene, currentScene) {
165 function domUpdate(newScene, currentScene) {
167 ElmRuntime.draw(function(_) {
166 ElmRuntime.draw(function(_) {
168− Render.update(elm.node.firstChild, currentScene, newScene);
167+ Render.update(elm.node.firstChild, currentScene, newScene);
169− if (elm.Native.Window) elm.Native.Window.resizeIfNeeded();
168+ if (elm.Native.Window) elm.Native.Window.resizeIfNeeded();
171 return newScene;
170 return newScene;
173− return A3(Signal.foldp, F2(domUpdate), currentScene, signalGraph);
172+ var renderer = A3(Signal.foldp, F2(domUpdate), currentScene, signalGraph);
174+ // must check for resize after 'renderer' is created so
175+ // that changes show up.
176+ if (elm.Native.Window) elm.Native.Window.resizeIfNeeded();