MCPcopy Create free account
hub / github.com/emilk/egui_plot / polygon

Method polygon

egui_plot/src/plot.rs:2038–2048  ·  view source on GitHub ↗

Add a polygon. The polygon has to be convex.

(&mut self, mut polygon: crate::Polygon<'a>)

Source from the content-addressed store, hash-verified

2036
2037 /// Add a polygon. The polygon has to be convex.
2038 pub fn polygon(&mut self, mut polygon: crate::Polygon<'a>) {
2039 if polygon.series.is_empty() {
2040 return;
2041 }
2042
2043 // Give the stroke an automatic color if no color has been assigned.
2044 if polygon.stroke.color == Color32::TRANSPARENT {
2045 polygon.stroke.color = self.auto_color();
2046 }
2047 self.items.push(Box::new(polygon));
2048 }
2049
2050 /// Add a text.
2051 pub fn text(&mut self, text: crate::Text) {

Callers 1

show_plotMethod · 0.80

Calls 2

is_emptyMethod · 0.80
auto_colorMethod · 0.80

Tested by

no test coverage detected