From 292dfb8ee3b1c769b1b1781f77e270628280aaca Mon Sep 17 00:00:00 2001 From: djmil Date: Sat, 31 Aug 2024 20:12:35 +0200 Subject: [PATCH] bug: wasm32 initsl window size --- src/circle.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/circle.rs b/src/circle.rs index 91da5c4..71cde03 100644 --- a/src/circle.rs +++ b/src/circle.rs @@ -55,6 +55,12 @@ impl Circle { debug!("bb: {}..{} {}..{}",bb.left(), bb.right(), bb.top(), bb.bottom() ); + if bb.width() > 2048.0 || bb.height() > 2048.0 { + // BUG: intial window size for wasm32 target tends to be significantly + // wider than in reality + return Circle::default() + } + Self { r: rand::thread_rng().gen_range(20.0..50.0), c: Pos2 {