Skip to content

Commit bb686fb

Browse files
committed
Make line width an f32
1 parent b6b5ef8 commit bb686fb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/function.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use style;
2525
#[derive(Debug, Default)]
2626
pub struct Style {
2727
colour: Option<String>,
28-
width: Option<u8>,
28+
width: Option<f32>,
2929
}
3030

3131
impl Style {
@@ -64,13 +64,13 @@ impl style::Line for Style {
6464

6565
fn width<T>(&mut self, value: T) -> &mut Self
6666
where
67-
T: Into<u8>,
67+
T: Into<f32>,
6868
{
6969
self.width = Some(value.into());
7070
self
7171
}
7272

73-
fn get_width(&self) -> &Option<u8> {
73+
fn get_width(&self) -> &Option<f32> {
7474
&self.width
7575
}
7676
}

src/style.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ pub trait Line {
1313

1414
fn width<T>(&mut self, value: T) -> &mut Self
1515
where
16-
T: Into<u8>;
16+
T: Into<f32>;
1717

18-
fn get_width(&self) -> &Option<u8>;
18+
fn get_width(&self) -> &Option<f32>;
1919
}
2020

2121
/**

src/svg_render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ where
231231
node::element::Path::new()
232232
.set("fill", "none")
233233
.set("stroke", style.get_colour().clone().unwrap_or("".into()))
234-
.set("stroke-width", style.get_width().clone().unwrap_or(2))
234+
.set("stroke-width", style.get_width().clone().unwrap_or(2.))
235235
.set("d", path),
236236
);
237237

0 commit comments

Comments
 (0)