use crate::{
graphics::{Shape, Size},
DebugWidget, ToAny, Widget,
};
#[derive(Debug, Clone)]
pub struct Image {
pub ratio: (f32, f32),
}
crate::dynamic_widget!(Image);
impl Widget for Image {
fn shape(&self, _size: Option<Size>) -> Shape {
panic!("cannot return shape")
}
}
impl Default for Image {
fn default() -> Self {
Self {
ratio: (1.0, 1.0),
}
}
}
impl Image {
pub fn new(ratio: (f32, f32)) -> Self {
Self {
ratio,
}
}
}