Parse IDML corner option families

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 09:05:19 -05:00
1 parent 4fd8f64e78
commit c2fd26d889
1 file changed
+13
+13
View File
@@ -94,6 +94,12 @@ pub struct TableOptions {
pub borders: [StrokeValues; 4],
}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CornerValues {
pub option: Option<String>,
pub radius: Option<f64>,
}
impl Values {
/// The attributes and `<Properties>` 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