pub fn draw_modal_card(
rect: Rect,
bg: Color,
border: Option<Color>,
radius: f32,
) -> Vec<DrawCmd>Expand description
Draws a rounded popup card and optional top/bottom one-pixel rules.
None returns only the background command; Some returns three commands.
Side borders are intentionally absent. Radius and rect are logical pixels
and are not clamped or normalized.
ยงExamples
use ailloli_ui_core::{Color, Rect};
use ailloli_ui_widgets::overlay::popup::draw_modal_card;
let commands = draw_modal_card(Rect::new(0.0, 0.0, 100.0, 60.0), Color::BLACK, Some(Color::WHITE), 8.0);
assert_eq!(commands.len(), 3);
assert_eq!(draw_modal_card(Rect::new(0.0, 0.0, 1.0, 1.0), Color::BLACK, None, 0.0).len(), 1);