瀏覽代碼

In demo sample, fix form submit animation not playing smoothly on power saving mode

Michael Ragazzon 2 年之前
父節點
當前提交
3176c85846
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Samples/basic/demo/src/main.cpp

+ 4 - 2
Samples/basic/demo/src/main.cpp

@@ -166,6 +166,8 @@ public:
 				if (auto el_output = document->GetElementById("form_output"))
 					el_output->SetInnerRML(submit_message);
 			}
+
+			document->GetContext()->RequestNextUpdate(.0);
 		}
 	}
 
@@ -465,9 +467,9 @@ int main(int /*argc*/, char** /*argv*/)
 	bool running = true;
 	while (running)
 	{
-		running = Backend::ProcessEvents(context, &Shell::ProcessKeyDownShortcuts, true);
-
 		demo_window->Update();
+
+		running = Backend::ProcessEvents(context, &Shell::ProcessKeyDownShortcuts, true);
 		context->Update();
 
 		Backend::BeginFrame();