2
0
Эх сурвалжийг харах

Revert "tentative fix at pixel alignment issues"

ncannasse 11 жил өмнө
parent
commit
fa3a2d9732
3 өөрчлөгдсөн 4 нэмэгдсэн , 8 устгасан
  1. 3 2
      h2d/Drawable.hx
  2. 0 5
      h2d/Scene.hx
  3. 1 1
      h2d/Tile.hx

+ 3 - 2
h2d/Drawable.hx

@@ -417,8 +417,9 @@ class Drawable extends Sprite {
 
 		if( options & HAS_SIZE != 0 ) {
 			var tmp = core.tmpSize;
-			tmp.x = tile.width;
-			tmp.y = tile.height;
+			// adds 1/10 pixel size to prevent precision loss after scaling
+			tmp.x = tile.width + 0.1;
+			tmp.y = tile.height + 0.1;
 			tmp.z = 1;
 			shader.size = tmp;
 		}

+ 0 - 5
h2d/Scene.hx

@@ -358,11 +358,6 @@ class Scene extends Layers implements h3d.IDrawable {
 		var h = -2 / height;
 		absX = absX * w - 1;
 		absY = absY * h + 1;
-		
-		// half pixel align
-		absX += 1 / width;
-		absY -= 1 / height;
-		
 		matA *= w;
 		matB *= h;
 		matC *= w;

+ 1 - 1
h2d/Tile.hx

@@ -3,7 +3,7 @@ package h2d;
 @:allow(h2d)
 class Tile {
 	
-	static inline var EPSILON_PIXEL = 0;
+	static inline var EPSILON_PIXEL = 0.001;
 	
 	var innerTex : h3d.mat.Texture;