From 20aa6d2a6ea2acfed3b2e9f5d3c4852a47e8b718 Mon Sep 17 00:00:00 2001
From: Aloshi <aloshi@aloshi>
Date: Wed, 10 Oct 2012 10:26:14 -0500
Subject: [PATCH] Updated THEMES.md to reflect tiling changes.

---
 THEMES.md                   |  5 +----
 src/components/GuiImage.cpp | 21 +++++++++------------
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/THEMES.md b/THEMES.md
index 4c7c3a2d6..9e1d17b1b 100644
--- a/THEMES.md
+++ b/THEMES.md
@@ -48,7 +48,7 @@ Used to display an image.
 
 `<origin>` - the point on the image that `<pos>` defines, as an image percentage. "0.5 0.5", the center of the image, by default.
 
-`<tiled />` - if present, the image is tiled instead of resized. A smaller image tiled many times is **slower** than a larger immage tiled few times.
+`<tiled />` - if present, the image is tiled instead of resized.
 
 
 Display tags
@@ -98,9 +98,6 @@ The Fast Select box can be themed with these tags:
 `<boxCorner>` - path to the "top left corner" image file. It will be flipped for the top right, bottom right, and bottom left corners. ~ and . are expanded.
 
 
-**NOTE:** The tiling tags are in and will tile, but will not properly cut off where they should. This should be fixed in a later commit.
-
-
 List of variables
 =================
 
diff --git a/src/components/GuiImage.cpp b/src/components/GuiImage.cpp
index 563f48c4b..db9892268 100644
--- a/src/components/GuiImage.cpp
+++ b/src/components/GuiImage.cpp
@@ -284,11 +284,8 @@ void GuiImage::onRender()
 	}
 }
 
-void GuiImage::buildImageArray(int posX, int posY, GLfloat* points, GLfloat* texs, float percentageX, float percentageY)
+void GuiImage::buildImageArray(int posX, int posY, GLfloat* points, GLfloat* texs, float px, float py)
 {
-	float px = percentageX;
-	float py = percentageY;
-
 	points[0] = posX - (mDrawWidth * mOriginX) * px;		points[1] = posY - (mDrawHeight * mOriginY) * py;
 	points[2] = posX - (mDrawWidth * mOriginX) * px;		points[3] = posY + (mDrawHeight * (1 - mOriginY)) * py;
 	points[4] = posX + (mDrawWidth * (1 - mOriginX)) * px;		points[5] = posY - (mDrawHeight * mOriginY) * py;
@@ -299,29 +296,29 @@ void GuiImage::buildImageArray(int posX, int posY, GLfloat* points, GLfloat* tex
 
 
 
-	texs[0] = 0;		texs[1] = percentageY;
+	texs[0] = 0;		texs[1] = py;
 	texs[2] = 0;		texs[3] = 0;
-	texs[4] = percentageX;	texs[5] = percentageY;
+	texs[4] = px;		texs[5] = py;
 
-	texs[6] = percentageX;	texs[7] = percentageY;
+	texs[6] = px;		texs[7] = py;
 	texs[8] = 0;		texs[9] = 0;
-	texs[10] = percentageX;	texs[11] = 0;
+	texs[10] = px;		texs[11] = 0;
 
 	if(mFlipX)
 	{
 		for(int i = 0; i < 11; i += 2)
-			if(texs[i] == percentageX)
+			if(texs[i] == px)
 				texs[i] = 0;
 			else
-				texs[i] = percentageX;
+				texs[i] = px;
 	}
 	if(mFlipY)
 	{
 		for(int i = 1; i < 12; i += 2)
-			if(texs[i] == percentageY)
+			if(texs[i] == py)
 				texs[i] = 0;
 			else
-				texs[i] = percentageY;
+				texs[i] = py;
 	}
 }