瀏覽代碼

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

Togi 5 年之前
父節點
當前提交
50ff54d810
共有 1 個文件被更改,包括 4 次插入1 次删除
  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);