From 5f9c311f41efd517026a82c1ec10bb60d4c49f94 Mon Sep 17 00:00:00 2001 From: bdew Date: Thu, 27 Feb 2014 11:13:40 +0200 Subject: [PATCH] Fixed BaseScreen not drawing the background in correct position --- src/net/bdew/lib/gui/BaseScreen.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/net/bdew/lib/gui/BaseScreen.scala b/src/net/bdew/lib/gui/BaseScreen.scala index cdf6b4b..69e4fdc 100644 --- a/src/net/bdew/lib/gui/BaseScreen.scala +++ b/src/net/bdew/lib/gui/BaseScreen.scala @@ -12,6 +12,7 @@ package net.bdew.lib.gui import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.inventory.Container import scala.collection.mutable +import org.lwjgl.opengl.GL11 abstract class BaseScreen(cont: Container, xSz: Int, ySz: Int) extends GuiContainer(cont) { xSize = xSz @@ -60,6 +61,10 @@ abstract class BaseScreen(cont: Container, xSz: Int, ySz: Int) extends GuiContai protected def drawGuiContainerBackgroundLayer(f: Float, x: Int, y: Int) { if (background != null) widgets.drawTexture(rect, background) - widgets.drawBackground(Point(x, y)) + + GL11.glPushMatrix() + GL11.glTranslatef(rect.x, rect.y, 0) + widgets.drawBackground(Point(x, y) - rect.origin) + GL11.glPopMatrix() } }