瀏覽代碼

Reduced the width and height of rectanges by one pixel.

rude 16 年之前
父節點
當前提交
c269430981
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      src/modules/graphics/opengl/Graphics.cpp

+ 7 - 7
src/modules/graphics/opengl/Graphics.cpp

@@ -915,7 +915,7 @@ namespace opengl
 		glEnable(GL_TEXTURE_2D);
 		glEnable(GL_TEXTURE_2D);
 	}
 	}
 
 
-	void Graphics::rectangle(DrawMode mode, float x, float y, float w, float h )
+	void Graphics::rectangle(DrawMode mode, float x, float y, float w, float h)
 	{
 	{
 		glDisable(GL_TEXTURE_2D);
 		glDisable(GL_TEXTURE_2D);
 		glPushMatrix();
 		glPushMatrix();
@@ -925,9 +925,9 @@ namespace opengl
 		case DRAW_LINE:
 		case DRAW_LINE:
 			glBegin(GL_LINE_LOOP);
 			glBegin(GL_LINE_LOOP);
 				glVertex2f(x, y);
 				glVertex2f(x, y);
-				glVertex2f(x, y+h);
-				glVertex2f(x+w, y+h);
-				glVertex2f(x+w, y);
+				glVertex2f(x, y+h-1);
+				glVertex2f(x+w-1, y+h-1);
+				glVertex2f(x+w-1, y);
 			glEnd();
 			glEnd();
 			break;
 			break;
 
 
@@ -935,9 +935,9 @@ namespace opengl
 		case DRAW_FILL:
 		case DRAW_FILL:
 			glBegin(GL_QUADS);
 			glBegin(GL_QUADS);
 				glVertex2f(x, y);
 				glVertex2f(x, y);
-				glVertex2f(x, y+h);
-				glVertex2f(x+w, y+h);
-				glVertex2f(x+w, y);
+				glVertex2f(x, y+h-1);
+				glVertex2f(x+w-1, y+h-1);
+				glVertex2f(x+w-1, y);
 			glEnd();
 			glEnd();
 			break;
 			break;
 		}
 		}