Function draw_image

Source
pub fn draw_image(rect: Rect, image: ImageRef, tint: Color) -> Option<DrawCmd>
Expand description

The runtime IR currently supports Lucide icons via IconId only.

Image(ImageId) is reserved for future use and does not emit DrawCmd yet. Coordinates, tint, and icon source are otherwise passed through unchanged, with rotation fixed at zero radians.

ยงExamples

use ailloli_ui_core::{Color, IconId, ImageId, Rect};
use ailloli_ui_widgets::primitives::{draw_image, ImageRef};
let rect = Rect::new(0.0, 0.0, 16.0, 16.0);
assert!(draw_image(rect, ImageRef::Icon(IconId::Close), Color::WHITE).is_some());
assert!(draw_image(rect, ImageRef::Image(ImageId(7)), Color::WHITE).is_none());