Przeglądaj źródła

bugfix: correctly pop filter if object offscreen (#760)

Togi 5 lat temu
rodzic
commit
50ff54d810
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      h2d/Object.hx

+ 4 - 1
h2d/Object.hx

@@ -698,7 +698,10 @@ class Object #if (domkit && !domkit_heaps) implements domkit.Model<h2d.Object> #
 		var width = Math.ceil(total.xMax - xMin - 1e-10);
 		var height = Math.ceil(total.yMax - yMin - 1e-10);
 
-		if( width <= 0 || height <= 0 || total.xMax < total.xMin ) return;
+		if( width <= 0 || height <= 0 || total.xMax < total.xMin ) {
+			ctx.popFilter();
+			return;
+		}
 
 		var t = ctx.textures.allocTarget("filterTemp", width, height, false);
 		ctx.pushTarget(t, xMin, yMin, width, height);