fix(ui): make UI scale work in DAWs (live zoom + window resize)#4
Open
Hornfisk wants to merge 1 commit into
Open
fix(ui): make UI scale work in DAWs (live zoom + window resize)#4Hornfisk wants to merge 1 commit into
Hornfisk wants to merge 1 commit into
Conversation
The UI-scale badge only wrote `ui_scale.txt`, which is read solely by the
standalone launcher (`niner-launch.sh --dpi-scale`). In a DAW nothing read
it and `Editor::set_scale_factor` was never driven from it, so clicking the
badge was a no-op in every host (not distro/WM-specific). Resizing the
window also did nothing — the editor never participated in host resize.
Drive both egui's content zoom and a matching programmatic window resize
from a single scale value, every frame:
ctx.set_zoom_factor(scale);
if editor_state.size() != BASE * scale { editor_state.set_requested_size(..) }
With baseview's native scale pinned to 1.0 (DAW hosts default to it; the
standalone launcher now passes `--dpi-scale 1.0`), effective ppp == scale:
the host window grows to BASE × scale physical pixels while the layout keeps
drawing into a fixed 680×444 logical space. Uniform scale, no reflow — knob
rows never move relative to each other.
- src/ui/editor.rs: per-frame zoom + resize reconcile; honest badge tooltip/log.
- src/params.rs: open pre-scaled (new BASE_WINDOW_SIZE const) to avoid a
first-frame resize flash.
- tools/niner-launch.sh: pin --dpi-scale 1.0; plugin owns scaling now.
- Cargo.toml: repoint nih_plug/nih_plug_egui to Hornfisk/nih-plug@8b51e93,
which exposes EguiState::set_requested_size (private upstream).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3.
Problem
The
UI 1.5xbadge only wroteui_scale.txt(read solely by the standalone launcher via--dpi-scale). In a DAW nothing read it andEditor::set_scale_factorwas never driven from it, so clicking the badge — and resizing the window — did nothing in every host.Fix
Drive egui content zoom + a matching programmatic window resize from one scale value, every frame:
With baseview's native scale pinned to 1.0 (DAW hosts default to it; the launcher now passes
--dpi-scale 1.0), effective ppp ==scale: the host window grows to680×444 × scalephysical px while the layout keeps drawing into a fixed680×444logical space. Uniform scale, no reflow — knob rows never move relative to each other.Changes
src/ui/editor.rs— per-frame zoom + resize reconcile; honest badge tooltip/log.src/params.rs— open pre-scaled (newBASE_WINDOW_SIZEconst) to avoid a first-frame resize flash.tools/niner-launch.sh— pin--dpi-scale 1.0; plugin owns scaling now.Cargo.toml— repointnih_plug/nih_plug_eguitoHornfisk/nih-plug@8b51e93(upstream28b149e+ one line exposingEguiState::set_requested_size, private upstream — mirrors the existingHornfisk/baseviewpatch pattern).Verification
cargo checkclean;cargo testgreen (7 tests).niner-launch.sh. If a host ignoresrequest_resize, it degrades to opening at the right size (still better than today).🤖 Generated with Claude Code