From c6e798b5a06752eea99b1745270130b12138e062 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sat, 26 Aug 2023 18:21:58 +0200 Subject: [PATCH] fix current zoom level when enabling bezels --- Changes.txt | 2 +- src/emucore/FrameBuffer.cxx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Changes.txt b/Changes.txt index 3168485b0..f3b51588d 100644 --- a/Changes.txt +++ b/Changes.txt @@ -24,7 +24,7 @@ * Added 2nd UI theme and hotkey for toggling UI theme. - * Added bezel support. + * Added bezel support (incl. Sinden Lightgun). * Added optional type format detection based on colors used. diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index c78184c9d..c8ba27cc8 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -1277,6 +1277,14 @@ void FrameBuffer::toggleBezel(bool toggle) enabled = !enabled; myOSystem.settings().setValue("bezel.show", enabled); myBezel->load(); + + // Determine possible TIA windowed zoom levels + const double currentTIAZoom = + static_cast(myOSystem.settings().getFloat("tia.zoom")); + myOSystem.settings().setValue("tia.zoom", + BSPF::clamp(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom())); + + saveCurrentWindowPosition(); applyVideoMode(); } }