From 2d9840c90107f28b6ceac2930af57f675ea8f482 Mon Sep 17 00:00:00 2001 From: dawnDus <96957561+dawndus@users.noreply.github.com> Date: Sat, 2 Apr 2022 16:45:53 -0400 Subject: [PATCH] adjust background for freeware widescreen --- src/components/background.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/background.rs b/src/components/background.rs index ef03153..f1a615c 100644 --- a/src/components/background.rs +++ b/src/components/background.rs @@ -105,20 +105,20 @@ impl Background { let offset_y = ((state.canvas_size.1 - 240.0) / 2.0).floor(); // Sun/Moon with 100px buffers on either side - let (width, center) = if state.constants.is_switch { - (427, ((state.canvas_size.0 - 427.0) / 2.0).floor()) + let (start, width, center) = if state.constants.is_switch { + (0, 427, ((state.canvas_size.0 - 427.0) / 2.0).floor()) } else { - (320, ((state.canvas_size.0 - 320.0) / 2.0).floor()) + (144, 320, ((state.canvas_size.0 - 320.0) / 2.0).floor()) }; for x in (0..(center as i32)).step_by(100) { - batch.add_rect(x as f32, offset_y, &Rect::new_size(0, 0, 100, 88)); + batch.add_rect(x as f32, offset_y, &Rect::new_size(start, 0, 100, 88)); } batch.add_rect(center, offset_y, &Rect::new_size(0, 0, width, 88)); for x in (center as i32 + width as i32..(state.canvas_size.0 as i32)).step_by(100) { - batch.add_rect(x as f32, offset_y, &Rect::new_size(0, 0, 100, 88)); + batch.add_rect(x as f32, offset_y, &Rect::new_size(start, 0, 100, 88)); } // top / bottom edges