Swapped y1 and y2 in calculate_bounds_text2d so the aabb's y extent is positive, allowing the calculate_bounds_text2d_create_aabb test to pass.

This commit is contained in:
ickshonpe 2025-07-15 10:47:38 +01:00
parent 90a980ece1
commit 8aca277350

View File

@ -370,8 +370,8 @@ pub fn calculate_bounds_text2d(
let x1 = (Anchor::TOP_LEFT.0.x - anchor.as_vec().x) * size.x;
let x2 = (Anchor::TOP_LEFT.0.x - anchor.as_vec().x + 1.) * size.x;
let y1 = (Anchor::TOP_LEFT.0.y - anchor.as_vec().y) * size.y;
let y2 = (Anchor::TOP_LEFT.0.y - anchor.as_vec().y - 1.) * size.y;
let y1 = (Anchor::TOP_LEFT.0.y - anchor.as_vec().y - 1.) * size.y;
let y2 = (Anchor::TOP_LEFT.0.y - anchor.as_vec().y) * size.y;
let new_aabb = Aabb::from_min_max(Vec3::new(x1, y1, 0.), Vec3::new(x2, y2, 0.));
if let Some(mut aabb) = aabb {