Interface size setting: auto, large, medium or small on the world's pixel grid
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
95655a0886
commit
70f112543f
21 files changed
+50
-11
No files matched your search
+6
-2
@@ -976,8 +976,12 @@ async fn main() {
|
||||
// 1080 device rows in landscape; a smaller screen draws in device pixels)
|
||||
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
|
||||
let short = rows * need.div_ceil(rows);
|
||||
// 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),
|
||||
};
|
||||
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 };
|
||||
ui::set_virtual_rows(vrows);
|
||||
|
||||
Reference in new issue
Block a user