summaryrefslogtreecommitdiff
path: root/src/attributes/ratio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/attributes/ratio.rs')
-rw-r--r--src/attributes/ratio.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/attributes/ratio.rs b/src/attributes/ratio.rs
new file mode 100644
index 0000000..a8fbad8
--- /dev/null
+++ b/src/attributes/ratio.rs
@@ -0,0 +1,22 @@
+use crate::dot::DotString;
+use std::borrow::Cow;
+
+pub enum Ratio {
+ Aspect(f32),
+ Fill,
+ Compress,
+ Expand,
+ Auto,
+}
+
+impl<'a> DotString<'a> for Ratio {
+ fn dot_string(&self) -> Cow<'a, str> {
+ match self {
+ Ratio::Aspect(aspect) => aspect.to_string().into(),
+ Ratio::Fill => "fill".into(),
+ Ratio::Compress => "compress".into(),
+ Ratio::Expand => "expand".into(),
+ Ratio::Auto => "auto".into(),
+ }
+ }
+}