Skip to content

Commit 74bfee5

Browse files
committed
fix: incorrect bounds on drawAlignedBox
fixes #387
1 parent e55014d commit 74bfee5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/util/render/DrawContextExt.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,11 @@ class LineRenderer(vertexConsumers: MultiBufferSource.BufferSource) :
145145
}
146146

147147

148-
fun GuiGraphics.drawAlignedBox(fromX: Int, fromY: Int, toX: Int, toY: Int, color: Int) {
148+
fun GuiGraphics.drawAlignedBox(fromX: Int, fromY: Int, width: Int, height: Int, color: Int) {
149+
val toY = fromY + height
150+
val toX = fromX + width
149151
vLine(fromX, fromY, toY, color)
150-
vLine(toY, fromY, toY, color)
152+
vLine(toX, fromY, toY, color)
151153
hLine(fromX, toX, fromY, color)
152154
hLine(fromX, toX, toY, color)
153155
}

0 commit comments

Comments
 (0)