Skip to content

Commit

Permalink
fix(BlockOutline): close the outline loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ccetl authored Jan 3, 2025
1 parent e039ef8 commit 37dc742
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ fun RenderEnvironment.drawSideBox(box: Box, side: Direction, onlyOutline: Boolea
vertex(matrix, x, y, z)
}

if(onlyOutline) {
if (onlyOutline) {
vertex(matrix, vertices[0].x, vertices[0].y, vertices[0].z)
}

Expand Down Expand Up @@ -482,6 +482,10 @@ fun RenderEnvironment.drawBoxSide(box: Box, side: Direction, face: Color4b, outl
vertex(matrix, x, y, z).color(outline.r, outline.g, outline.b, outline.a)
}

// close the loop
val firstVertex = vertices[0]
vertex(matrix, firstVertex.x, firstVertex.y, firstVertex.z).color(outline.r, outline.g, outline.b, outline.a)

// Draw the outlined box
BufferRenderer.drawWithGlobalProgram(buffer.endNullable() ?: return)
}
Expand Down

0 comments on commit 37dc742

Please sign in to comment.