Fixed Plot Line::fill
does not fill last segment correctly (#2275)
* Fix missing vertex to fill the triangle Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
parent
b1e71d308f
commit
b2edbe617e
1 changed files with 1 additions and 1 deletions
|
@ -447,7 +447,7 @@ impl PlotItem for Line {
|
|||
let expected_intersections = 20;
|
||||
mesh.reserve_triangles((n_values - 1) * 2);
|
||||
mesh.reserve_vertices(n_values * 2 + expected_intersections);
|
||||
values_tf[0..n_values - 1].windows(2).for_each(|w| {
|
||||
values_tf.windows(2).for_each(|w| {
|
||||
let i = mesh.vertices.len() as u32;
|
||||
mesh.colored_vertex(w[0], fill_color);
|
||||
mesh.colored_vertex(pos2(w[0].x, y), fill_color);
|
||||
|
|
Loading…
Reference in a new issue