@@ -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;
}
@@ -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;
@@ -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;