use std::any::TypeId;
use crate::core::{Property, UpdateCtx};
#[expect(missing_docs, reason = "field names are self-descriptive")]
#[derive(Default, Clone, Copy, Debug, PartialEq)]
pub struct CornerRadius {
pub radius: f64,
}
impl Property for CornerRadius {
fn static_default() -> &'static Self {
static DEFAULT: CornerRadius = CornerRadius { radius: 0. };
&DEFAULT
}
}
impl CornerRadius {
pub const fn all(radius: f64) -> Self {
Self { radius }
}
pub fn prop_changed(ctx: &mut UpdateCtx<'_>, property_type: TypeId) {
if property_type != TypeId::of::<Self>() {
return;
}
ctx.request_layout();
}
}