glifparser/matrix/
write.rs

1#[rustfmt::skip]
2// Both components and images have the same matrix/identifier values.
3macro_rules! write_matrix {
4    ($xml_el:ident, $struct:ident) => {
5        match $struct.identifier {
6            Some(ref id) => {$xml_el.attributes.insert("identifier".to_string(), id.clone());},
7            None  => {}
8        }
9        $xml_el.attributes.insert("xScale".to_string(), $struct.xScale.to_string());
10        $xml_el.attributes.insert("xyScale".to_string(), $struct.xyScale.to_string());
11        $xml_el.attributes.insert("yxScale".to_string(), $struct.yxScale.to_string());
12        $xml_el.attributes.insert("yScale".to_string(), $struct.yScale.to_string());
13        $xml_el.attributes.insert("xOffset".to_string(), $struct.xOffset.to_string());
14        $xml_el.attributes.insert("yOffset".to_string(), $struct.yOffset.to_string());
15    }
16}
17
18pub(crate) use write_matrix;