diff --git a/crates/idml/src/model/mod.rs b/crates/idml/src/model/mod.rs index ef6fb7a6f..916dbcb90 100644 --- a/crates/idml/src/model/mod.rs +++ b/crates/idml/src/model/mod.rs @@ -94,6 +94,12 @@ pub struct TableOptions { pub borders: [StrokeValues; 4], } +#[derive(Clone, Debug, Default, PartialEq)] +pub struct CornerValues { + pub option: Option, + pub radius: Option, +} + impl Values { /// The attributes and `` of `el`. pub fn of(el: &El) -> Values { @@ -275,6 +281,13 @@ impl Values { ], } } + + pub fn corner_values(&self, corner: &str) -> CornerValues { + CornerValues { + option: self.value(&format!("{corner}CornerOption")).or_else(|| self.value("CornerOption")), + radius: self.num(&format!("{corner}CornerRadius")).or_else(|| self.num("CornerRadius")), + } + } } /// `el` without its indentation: the whitespace-only text between the children of an element