From e275cfb7ee32688845bd0ce79836bef3cf9ef5b6 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sun, 4 Mar 2012 13:24:01 +0000 Subject: [PATCH] JME nifty's render device : fixed text positioning when autoScale is true git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9230 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../niftygui/com/jme3/niftygui/RenderDeviceJme.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java b/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java index 858b95878..17219067b 100644 --- a/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java +++ b/engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java @@ -236,16 +236,8 @@ public class RenderDeviceJme implements RenderDevice { // niftyMat.getAdditionalRenderState().setBlendMode(convertBlend()); text.setMaterial(niftyMat); - float width = text.getLineWidth(); - float height = text.getLineHeight(); - -// System.out.println("----------------------------------------------------"); -// System.out.println("POS "+x+" "+width+" "+sizeX); - float x0 = x + 0.5f * width * (1.0f - sizeX); - float y0 = y + 0.5f * height * (1.0f - sizeY); - tempMat.loadIdentity(); - tempMat.setTranslation(x0, getHeight() - y0, 0); + tempMat.setTranslation(x, getHeight() - y, 0); tempMat.setScale(sizeX, sizeY, 0); rm.setWorldMatrix(tempMat);