mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -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:
@@ -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.
|
/// Paints a horizontal line.
|
||||||
pub fn hline(&self, x: impl Into<Rangef>, y: f32, stroke: impl Into<PathStroke>) -> ShapeIdx {
|
pub fn hline(&self, x: impl Into<Rangef>, y: f32, stroke: impl Into<PathStroke>) -> ShapeIdx {
|
||||||
self.add(Shape::hline(x, y, stroke.into()))
|
self.add(Shape::hline(x, y, stroke.into()))
|
||||||
|
|||||||
Reference in New Issue
Block a user