Skip to content

Commit

Permalink
added better smoothness to label
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaOber committed Oct 3, 2024
1 parent 32d90c1 commit 35da065
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions charming/src/element/label.rs
Original file line number Diff line number Diff line change
@@ -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")]
Expand Down Expand Up @@ -246,7 +246,7 @@ pub struct LabelLine {
length: Option<f64>,

#[serde(skip_serializing_if = "Option::is_none")]
smooth: Option<bool>,
smooth: Option<Smoothness>,

#[serde(skip_serializing_if = "Option::is_none")]
min_turn_angle: Option<f64>,
Expand Down Expand Up @@ -288,8 +288,8 @@ impl LabelLine {
self
}

pub fn smooth(mut self, smooth: bool) -> Self {
self.smooth = Some(smooth);
pub fn smooth<F: Into<Smoothness>>(mut self, smoothness: F) -> Self {
self.smooth = Some(smoothness.into());
self
}

Expand Down

0 comments on commit 35da065

Please sign in to comment.