3 Commits
Author SHA1 Message Date
NeilClack 43cd93bbd7 Switch from window-size to render-output-size 2026-08-25 11:30:20 -05:00
NeilClack 92ba9f39fb Switch from window-size to render-output-size 2026-08-25 11:28:02 -05:00
NeilClack 400c6a782b Scroller: use full window height on rotated/tall displays
build-dev / nix-build (push) Successful in 41s
Override the LETTERBOX logical presentation while the scroller is
active so it renders into the full physical window.  On a 1920x6480
rotated display the scroller now scrolls through all 6480 pixels of
vertical space instead of being confined to the 1920x1080 letterbox
region.  Text scale is unchanged (same font size, same pixel
rasterization); more lines are simply visible at once.

- onPush: save current logical presentation, switch to DISABLED with
  real window dimensions
- onPop: restore the saved LETTERBOX presentation
- resize handler in main.cpp: skip re-apply while scroller is active
  (it owns its own presentation and restores on pop)
2026-08-25 10:55:53 -05:00
3 changed files with 638 additions and 696 deletions
+10 -5
View File
@@ -7,6 +7,7 @@
#include "logical_size.h" #include "logical_size.h"
#include "logger/logger.h" #include "logger/logger.h"
#include "provisioning.h" #include "provisioning.h"
#include "scroller_page.h"
namespace { namespace {
// How long audio fades out before the app tears down on quit. Only applied // How long audio fades out before the app tears down on quit. Only applied
@@ -201,11 +202,15 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event) {
std::to_string(event->window.data1) + "x" + std::to_string(event->window.data1) + "x" +
std::to_string(event->window.data2)); std::to_string(event->window.data2));
// Logical presentation persists across resizes; re-apply defensively // Logical presentation persists across resizes; re-apply defensively
// in case backend state was reset underneath us. // in case backend state was reset underneath us. Skip while the
SDL_SetRenderLogicalPresentation(state.renderer, // scroller is active — it owns its own presentation (NONE, full
radiantwave::kDesignWidth, // window) and restores LETTERBOX in onPop.
radiantwave::kDesignHeight, if (!dynamic_cast<ScrollerPage *>(state.pages.current())) {
SDL_LOGICAL_PRESENTATION_LETTERBOX); SDL_SetRenderLogicalPresentation(state.renderer,
radiantwave::kDesignWidth,
radiantwave::kDesignHeight,
SDL_LOGICAL_PRESENTATION_LETTERBOX);
}
} }
if (!state.keybinds.handleEvent(*event)) { if (!state.keybinds.handleEvent(*event)) {
+624 -691
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -115,4 +115,8 @@ private:
float velocityDelay_ = 2.5f; float velocityDelay_ = 2.5f;
int velocityState_ = 0; int velocityState_ = 0;
float velocityTimer_ = 0.0f; float velocityTimer_ = 0.0f;
int savedLogicalW_ = 0;
int savedLogicalH_ = 0;
SDL_RendererLogicalPresentation savedMode_ = SDL_LOGICAL_PRESENTATION_DISABLED;
}; };