浏览代码

fix black lines on high dpi screens (opengl)

ncannasse 12 年之前
父节点
当前提交
caa7001691
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      h2d/Tile.hx

+ 4 - 4
h2d/Tile.hx

@@ -43,8 +43,8 @@ class Tile {
 	function setTexture(tex) {
 		this.innerTex = tex;
 		if( tex != null ) {
-			this.u = x / tex.width;
-			this.v = y / tex.height;
+			this.u = (x + EPSILON_PIXEL) / tex.width;
+			this.v = (y + EPSILON_PIXEL) / tex.height;
 			this.u2 = (x + width - EPSILON_PIXEL) / tex.width;
 			this.v2 = (y + height - EPSILON_PIXEL) / tex.height;
 		}
@@ -63,8 +63,8 @@ class Tile {
 		this.y = y;
 		var tex = innerTex;
 		if( tex != null ) {
-			u = x / tex.width;
-			v = y / tex.height;
+			u = (x + EPSILON_PIXEL) / tex.width;
+			v = (y + EPSILON_PIXEL) / tex.height;
 		}
 	}