From ad7eea67c16264bb419b0450da999300e1414211 Mon Sep 17 00:00:00 2001 From: Mikael Tollefsen Date: Mon, 19 Oct 2026 14:02:14 +0200 Subject: [PATCH] =?UTF-8?q?ui=5Fshot:=20an=20out-of-range=20{"ppp":=20s}?= =?UTF-8?q?=20is=20clamped=20to=200.5=E2=80=934,=20not=20ignored?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A scale outside the range fell back to 2 instead of the nearest allowed one (review on #3101): {"ppp": 5} now gives 4, {"ppp": 0.1} gives 0.5. --- crates/ui-egui/examples/ui_shot.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/examples/ui_shot.rs b/crates/ui-egui/examples/ui_shot.rs index c10788daf8..2bbf2f3634 100644 --- a/crates/ui-egui/examples/ui_shot.rs +++ b/crates/ui-egui/examples/ui_shot.rs @@ -35,7 +35,7 @@ fn main() { } let w = lines.iter().find_map(|l| l.get("width").and_then(|v| v.as_f64())).unwrap_or(1440.0) as f32; let h = lines.iter().find_map(|l| l.get("height").and_then(|v| v.as_f64())).unwrap_or(900.0) as f32; - let ppp = lines.iter().find_map(|l| l.get("ppp").and_then(|v| v.as_f64())).filter(|p| (0.5..=4.0).contains(p)).unwrap_or(2.0) as f32; + let ppp = lines.iter().find_map(|l| l.get("ppp").and_then(|v| v.as_f64())).map(|p| p.clamp(0.5, 4.0)).unwrap_or(2.0) as f32; let mut harness = egui_kittest::Harness::builder().with_size(egui::vec2(w, h)).with_pixels_per_point(ppp).with_max_steps(1_000_000).wgpu().build_ui_state( |ui, app: &mut WordApp| {