[UI] Fix frame leak on context loss.
This commit is contained in:
parent
2c99228041
commit
f0723c211b
|
@ -199,7 +199,6 @@ void Window::OnPaint(UIEvent* e) {
|
||||||
}
|
}
|
||||||
io.DisplaySize = ImVec2(static_cast<float>(scaled_width()),
|
io.DisplaySize = ImVec2(static_cast<float>(scaled_width()),
|
||||||
static_cast<float>(scaled_height()));
|
static_cast<float>(scaled_height()));
|
||||||
ImGui::NewFrame();
|
|
||||||
|
|
||||||
context_->BeginSwap();
|
context_->BeginSwap();
|
||||||
if (context_->WasLost()) {
|
if (context_->WasLost()) {
|
||||||
|
@ -207,6 +206,8 @@ void Window::OnPaint(UIEvent* e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::NewFrame();
|
||||||
|
|
||||||
ForEachListener([e](auto listener) { listener->OnPainting(e); });
|
ForEachListener([e](auto listener) { listener->OnPainting(e); });
|
||||||
on_painting(e);
|
on_painting(e);
|
||||||
ForEachListener([e](auto listener) { listener->OnPaint(e); });
|
ForEachListener([e](auto listener) { listener->OnPaint(e); });
|
||||||
|
|
Loading…
Reference in New Issue