fix(ui): Prevent PopStyleColor crash by using frame-scoped tint flag
This commit is contained in:
@@ -256,9 +256,11 @@ class App:
|
|||||||
imgui.end_menu()
|
imgui.end_menu()
|
||||||
|
|
||||||
def _gui_func(self) -> None:
|
def _gui_func(self) -> None:
|
||||||
|
pushed_prior_tint = False
|
||||||
if self.perf_profiling_enabled: self.perf_monitor.start_component("_gui_func")
|
if self.perf_profiling_enabled: self.perf_monitor.start_component("_gui_func")
|
||||||
if self.is_viewing_prior_session:
|
if self.is_viewing_prior_session:
|
||||||
imgui.push_style_color(imgui.Col_.window_bg, vec4(50, 40, 20))
|
imgui.push_style_color(imgui.Col_.window_bg, vec4(50, 40, 20))
|
||||||
|
pushed_prior_tint = True
|
||||||
try:
|
try:
|
||||||
self.perf_monitor.start_frame()
|
self.perf_monitor.start_frame()
|
||||||
self._autofocus_response_tab = self.controller._autofocus_response_tab
|
self._autofocus_response_tab = self.controller._autofocus_response_tab
|
||||||
@@ -761,7 +763,7 @@ class App:
|
|||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
if self.is_viewing_prior_session:
|
if pushed_prior_tint:
|
||||||
imgui.pop_style_color()
|
imgui.pop_style_color()
|
||||||
|
|
||||||
if self.perf_profiling_enabled: self.perf_monitor.end_component("_gui_func")
|
if self.perf_profiling_enabled: self.perf_monitor.end_component("_gui_func")
|
||||||
|
|||||||
Reference in New Issue
Block a user