Skip to content

Commit

Permalink
Fix GL_RESTART_INDEX
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed May 15, 2024
1 parent cf0fbd4 commit 254304f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions azulc/src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,9 @@ pub fn join_tessellated_nodes(nodes: &[TessellatedSvgNode]) -> TessellatedSvgNod
if vertex_buffer_offset != 0 {
indices
.par_iter_mut()
.for_each(|i| { *i += vertex_buffer_offset; });
.for_each(|i| {
if *i != GL_RESTART_INDEX { *i += vertex_buffer_offset; }
});
}

indices.push(GL_RESTART_INDEX);
Expand Down Expand Up @@ -1341,7 +1343,9 @@ pub fn join_tessellated_colored_nodes(nodes: &[TessellatedColoredSvgNode]) -> Te
if vertex_buffer_offset != 0 {
indices
.par_iter_mut()
.for_each(|i| { *i += vertex_buffer_offset; });
.for_each(|i| {
if *i != GL_RESTART_INDEX { *i += vertex_buffer_offset; }
});
}

indices.push(GL_RESTART_INDEX);
Expand Down

0 comments on commit 254304f

Please sign in to comment.