From 35da06515ad53007f8fd6f30145e044d242cba04 Mon Sep 17 00:00:00 2001 From: LukaOber Date: Thu, 3 Oct 2024 12:18:31 +0200 Subject: [PATCH] added better smoothness to label --- charming/src/element/label.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }