diff --git a/src/net/bdew/lib/gui/Rect.scala b/src/net/bdew/lib/gui/Rect.scala index 55e02cd..d19ac91 100644 --- a/src/net/bdew/lib/gui/Rect.scala +++ b/src/net/bdew/lib/gui/Rect.scala @@ -15,4 +15,8 @@ case class Rect(x: Int, y: Int, w: Int, h: Int) { def origin = new Point(x, y) def +(p: Point) = new Rect(origin + p, w, h) def -(p: Point) = new Rect(origin - p, w, h) + def x1 = x + def x2 = x + w + def y1 = y + def y2 = y + w } diff --git a/src/net/bdew/lib/gui/WidgetContainer.scala b/src/net/bdew/lib/gui/WidgetContainer.scala index fa5f34c..87f2c11 100644 --- a/src/net/bdew/lib/gui/WidgetContainer.scala +++ b/src/net/bdew/lib/gui/WidgetContainer.scala @@ -98,10 +98,10 @@ class WidgetContainerWindow(val parent: BaseScreen, xSz: Int, ySz: Int) extends Minecraft.getMinecraft.renderEngine.bindTexture(l.resource) color.activate() Tessellator.instance.startDrawingQuads() - addVertexUVScaled(r.x, r.y + r.w, z, t.x, t.y + t.w) - addVertexUVScaled(r.x + r.h, r.y + r.w, z, t.x + t.h, t.y + t.w) - addVertexUVScaled(r.x + r.h, r.y, z, t.x + t.h, t.y) - addVertexUVScaled(r.x, r.y, z, t.x, t.y) + addVertexUVScaled(r.x1, r.y2, z, t.x1, t.y2) + addVertexUVScaled(r.x2, r.y2, z, t.x2, t.y2) + addVertexUVScaled(r.x2, r.y1, z, t.x2, t.y1) + addVertexUVScaled(r.x1, r.y1, z, t.x1, t.y1) Tessellator.instance.draw() }