xml anchor + GuiPanel minor refactor

This commit is contained in:
galister
2025-06-20 02:40:27 +09:00
parent d1e3f51b8a
commit 10aab5451f
6 changed files with 38 additions and 67 deletions

View File

@@ -169,7 +169,7 @@ fn new_toast(toast: Toast, app: &mut AppState) -> Option<(OverlayState, Box<dyn
toast.title
};
let mut panel = GuiPanel::new_blank(app, 2048).ok()?;
let mut panel = GuiPanel::new_blank(app).ok()?;
let (rect, _) = panel
.layout
@@ -231,10 +231,12 @@ fn new_toast(toast: Toast, app: &mut AppState) -> Option<(OverlayState, Box<dyn
},
);
panel.update_layout().ok()?;
let state = OverlayState {
name: TOAST_NAME.clone(),
want_visible: true,
spawn_scale: (panel.max_size as f32) * PIXELS_TO_METERS,
spawn_scale: panel.layout.content_size.x * PIXELS_TO_METERS,
spawn_rotation,
spawn_point,
z_order: Z_ORDER_TOAST,