mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-14 22:42:46 +00:00
Parse IDML corner option families
This commit is contained in:
1 file changed
+13
@@ -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
|
||||
|
||||
Reference in new issue
Block a user