Skip to content

Commit 3b8de06

Browse files
committed
Fix elements that drop the stroke width when drawing
1 parent e85d712 commit 3b8de06

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/element/boxplot.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<K, DB: DrawingBackend, O: BoxplotOrient<K, f32>> Drawable<DB> for Boxplot<K
213213
backend.draw_line(
214214
start_whisker(points[0]),
215215
end_whisker(points[0]),
216-
&self.style.color,
216+
&self.style,
217217
)?;
218218

219219
// |---[ | ]----|
@@ -226,22 +226,22 @@ impl<K, DB: DrawingBackend, O: BoxplotOrient<K, f32>> Drawable<DB> for Boxplot<K
226226
let corner2 = end_bar(points[1]);
227227
let upper_left = (corner1.0.min(corner2.0), corner1.1.min(corner2.1));
228228
let bottom_right = (corner1.0.max(corner2.0), corner1.1.max(corner2.1));
229-
backend.draw_rect(upper_left, bottom_right, &self.style.color, false)?;
229+
backend.draw_rect(upper_left, bottom_right, &self.style, false)?;
230230

231231
// |---[ | ]----|
232232
// ________^________
233-
backend.draw_line(start_bar(points[2]), end_bar(points[2]), &self.style.color)?;
233+
backend.draw_line(start_bar(points[2]), end_bar(points[2]), &self.style)?;
234234

235235
// |---[ | ]----|
236236
// ____________^^^^_
237-
backend.draw_line(moved(points[3]), moved(points[4]), &self.style.color)?;
237+
backend.draw_line(moved(points[3]), moved(points[4]), &self.style)?;
238238

239239
// |---[ | ]----|
240240
// ________________^
241241
backend.draw_line(
242242
start_whisker(points[4]),
243243
end_whisker(points[4]),
244-
&self.style.color,
244+
&self.style,
245245
)?;
246246
}
247247
Ok(())

src/element/candlestick.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ impl<X, Y: PartialOrd, DB: DrawingBackend> Drawable<DB> for CandleStick<X, Y> {
8787
self.width as i32 - self.width as i32 / 2,
8888
);
8989

90-
backend.draw_line(points[0], points[1], &self.style.color)?;
91-
backend.draw_line(points[2], points[3], &self.style.color)?;
90+
backend.draw_line(points[0], points[1], &self.style)?;
91+
backend.draw_line(points[2], points[3], &self.style)?;
9292

9393
points[0].0 -= l;
9494
points[3].0 += r;
9595

96-
backend.draw_rect(points[0], points[3], &self.style.color, fill)?;
96+
backend.draw_rect(points[0], points[3], &self.style, fill)?;
9797
}
9898
Ok(())
9999
}

src/element/points.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ impl<Coord, DB: DrawingBackend, Size: SizeDesc> Drawable<DB> for Cross<Coord, Si
4444
let size = self.size.in_pixels(&ps);
4545
let (x0, y0) = (x - size, y - size);
4646
let (x1, y1) = (x + size, y + size);
47-
backend.draw_line((x0, y0), (x1, y1), &self.style.color)?;
48-
backend.draw_line((x0, y1), (x1, y0), &self.style.color)?;
47+
backend.draw_line((x0, y0), (x1, y1), &self.style)?;
48+
backend.draw_line((x0, y1), (x1, y0), &self.style)?;
4949
}
5050
Ok(())
5151
}

0 commit comments

Comments
 (0)