1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

add painter.line() (#5291)

* Closes <https://github.com/emilk/egui/issues/5273>
* [x] I have followed the instructions in the PR template
This commit is contained in:
Nicolas
2024-11-26 15:17:47 +01:00
committed by GitHub
parent e28505077d
commit 12f9d6f42c

View File

@@ -344,6 +344,12 @@ impl Painter {
})
}
/// Paints a line connecting the points.
/// NOTE: all coordinates are screen coordinates!
pub fn line(&self, points: Vec<Pos2>, stroke: impl Into<PathStroke>) -> ShapeIdx {
self.add(Shape::line(points, stroke))
}
/// Paints a horizontal line.
pub fn hline(&self, x: impl Into<Rangef>, y: f32, stroke: impl Into<PathStroke>) -> ShapeIdx {
self.add(Shape::hline(x, y, stroke.into()))