diff --git a/charming/src/element/label.rs b/charming/src/element/label.rs index 240aed6..dd0662e 100644 --- a/charming/src/element/label.rs +++ b/charming/src/element/label.rs @@ -1,6 +1,6 @@ use serde::Serialize; -use super::{color::Color, line_style::LineStyle, Formatter}; +use super::{color::Color, line_style::LineStyle, smoothness::Smoothness, Formatter}; #[derive(Serialize)] #[serde(rename_all = "camelCase")] @@ -246,7 +246,7 @@ pub struct LabelLine { length: Option, #[serde(skip_serializing_if = "Option::is_none")] - smooth: Option, + smooth: Option, #[serde(skip_serializing_if = "Option::is_none")] min_turn_angle: Option, @@ -288,8 +288,8 @@ impl LabelLine { self } - pub fn smooth(mut self, smooth: bool) -> Self { - self.smooth = Some(smooth); + pub fn smooth>(mut self, smoothness: F) -> Self { + self.smooth = Some(smoothness.into()); self }