core: Show invalid bounds + selfbounds/scrollrect on DO debug info

This commit is contained in:
Nathan Adams 2023-06-05 00:13:36 +02:00
parent c8a41e327a
commit c5a1ca0e57
1 changed files with 30 additions and 2 deletions

View File

@ -374,11 +374,39 @@ impl DisplayObjectWindow {
ui.end_row(); ui.end_row();
ui.label("World Bounds"); ui.label("World Bounds");
if object.world_bounds().is_valid() {
ui.label(object.world_bounds().to_string()); ui.label(object.world_bounds().to_string());
} else {
ui.colored_label(ui.style().visuals.error_fg_color, "Invalid");
}
ui.end_row(); ui.end_row();
ui.label("Local Bounds"); ui.label("Local Bounds");
if object.local_bounds().is_valid() {
ui.label(object.local_bounds().to_string()); ui.label(object.local_bounds().to_string());
} else {
ui.colored_label(ui.style().visuals.error_fg_color, "Invalid");
}
ui.end_row();
ui.label("Self Bounds");
if object.self_bounds().is_valid() {
ui.label(object.self_bounds().to_string());
} else {
ui.colored_label(ui.style().visuals.error_fg_color, "Invalid");
}
ui.end_row();
ui.label("Scroll Rect");
if let Some(scroll_rect) = object.scroll_rect() {
if scroll_rect.is_valid() {
ui.label(scroll_rect.to_string());
} else {
ui.colored_label(ui.style().visuals.error_fg_color, "Invalid");
}
} else {
ui.label("None");
}
ui.end_row(); ui.end_row();
let matrix = *object.base().matrix(); let matrix = *object.base().matrix();