Interface size in finer percent steps; fixed sizes no longer double the interface
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d8aa0e5fc1
commit
361e1e4108
4 files changed
+52
-24
No files matched your search
+5
-5
@@ -475,7 +475,6 @@ fn next_seed(seed: u32) -> u32 {
|
||||
|
||||
fn apply_settings(s: &Settings, r3d: &mut R3d) {
|
||||
i18n::set_language(&s.language);
|
||||
ui::set_ui_factor(s.ui_factor);
|
||||
r3d.outlines = s.outlines;
|
||||
r3d.set_wall_detail(s.wall_subdivisions());
|
||||
r3d.max_lights = s.max_lights as usize;
|
||||
@@ -993,10 +992,11 @@ async fn main() {
|
||||
let need: u32 = 900;
|
||||
// measured on the shorter side: upright (portrait) the width gets those pixels and the
|
||||
// height grows with the screen, so the world and the menus keep their size. The setting
|
||||
// "interface size" picks the interface pixels per world pixel: large 2, medium 3, small 4
|
||||
let short = match app.settings.ui_factor {
|
||||
k @ 2..=4 => rows * k as u32,
|
||||
_ => rows * need.div_ceil(rows),
|
||||
// "interface size" picks the interface rows in percent of the standard (100% = 1080 rows);
|
||||
// on a screen with fewer rows the interface stays at the screen's rows
|
||||
let short = match app.settings.ui_size {
|
||||
0 => rows * need.div_ceil(rows),
|
||||
p => settings::ui_size_rows(p).min((screen_width().min(screen_height()) * screen_dpi_scale()).max(1.0) as u32),
|
||||
};
|
||||
let (w, h) = (screen_width().max(1.0), screen_height().max(1.0));
|
||||
let vrows = if h > w { (short as f32 * h / w).round() as u32 } else { short };
|
||||
|
||||
Reference in new issue
Block a user