pub fn draw_panel(rect: Rect, style: PanelStyle) -> Vec<DrawCmd>Expand description
Draws one panel fill and optional one-pixel top/bottom border rules.
Returns one command without a border and three with a border. Geometry is passed through without normalization; vertical side borders are absent.
ยงExamples
use ailloli_ui_core::{Color, Rect};
use ailloli_ui_widgets::layout::panel::{draw_panel, PanelStyle};
let style = PanelStyle { bg: Color::BLACK, border: Some(Color::WHITE), radius: 4.0 };
assert_eq!(draw_panel(Rect::new(0.0, 0.0, 80.0, 40.0), style).len(), 3);