0.1.0-0-pre.10-fix.1

This commit is contained in:
2026-09-16 10:22:53 +02:00
parent 88eda8390b
commit fa098943bf
4 changed files with 93 additions and 7 deletions

View File

@@ -1,11 +1,11 @@
// file: crates/engines/engine-v1-common/unit_tests/render.rs
// version: 1
// version: 2
#[test]
fn normalized_rect_clamps_and_contains_points() {
let rect = crate::NormalizedRect::new(0.8, 0.8, 0.5, 0.5);
assert_eq!(rect.width(), 0.2);
assert_eq!(rect.height(), 0.2);
assert!((rect.width() - 0.2).abs() < f32::EPSILON);
assert!((rect.height() - 0.2).abs() < f32::EPSILON);
assert!(rect.contains(0.9, 0.9));
assert!(!rect.contains(0.5, 0.5));
}

View File

@@ -1,5 +1,5 @@
// file: crates/engines/engine-v1-sdl/src/runtime.rs
// version: 6
// version: 7
/// Minimal SDL3 runtime used by Desktop and Android POC runners.
pub struct SdlRuntime {
@@ -110,7 +110,7 @@ fn render_scene(canvas: &mut sdl3::render::WindowCanvas, scene: engine_v1_common
let color = rectangle.color();
let rect = rectangle.rect();
canvas.set_draw_color(sdl3::pixels::Color::RGBA(color.red(), color.green(), color.blue(), color.alpha()));
let physical = sdl3::rect::FRect::new(rect.x() * width as f32, rect.y() * height as f32, rect.width() * width as f32, rect.height() * height as f32);
let physical = sdl3::render::FRect::new(rect.x() * width as f32, rect.y() * height as f32, rect.width() * width as f32, rect.height() * height as f32);
match canvas.fill_rect(physical) {
std::result::Result::Ok(()) => {},
std::result::Result::Err(error) => return std::result::Result::Err(error.to_string()),