0.1.0-0-pre.10

This commit is contained in:
2026-09-16 10:21:09 +02:00
parent a3d5572c37
commit 88eda8390b
16 changed files with 573 additions and 37 deletions

View File

@@ -0,0 +1,18 @@
// file: crates/engines/engine-v1-common/unit_tests/render.rs
// version: 1
#[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.contains(0.9, 0.9));
assert!(!rect.contains(0.5, 0.5));
}
#[test]
fn scene_accepts_render_rectangles() {
let target = crate::RenderRect::new(crate::NormalizedRect::new(0.2, 0.3, 0.4, 0.2), crate::RenderColor::rgb(255, 0, 0));
let scene = crate::EngineScene::empty(crate::RenderColor::rgb(0, 0, 0)).with_rect(target);
assert_eq!(scene.rectangles()[0], Some(target));
}