From 2d0a7cda6fdd0a3a3a21a68089e9b189f2d46767 Mon Sep 17 00:00:00 2001 From: pkhead Date: Mon, 2 Dec 2024 18:30:56 -0600 Subject: [PATCH] Fix GL scissor box in h2d.Scene.captureBitmap --- h2d/Scene.hx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/h2d/Scene.hx b/h2d/Scene.hx index 0d87365e7..02aad8d04 100644 --- a/h2d/Scene.hx +++ b/h2d/Scene.hx @@ -905,11 +905,12 @@ class Scene extends Layers implements h3d.IDrawable implements hxd.SceneEvents.I var tex = new h3d.mat.Texture(width, height, [Target]); target = new Tile(tex,0, 0, width, height); } + + var tex = target.getTexture(); engine.begin(); + engine.pushTarget(tex); engine.setRenderZone(Std.int(target.x), Std.int(target.y), hxd.Math.ceil(target.width), hxd.Math.ceil(target.height)); - var tex = target.getTexture(); - engine.pushTarget(tex); var ow = width, oh = height, ova = viewportA, ovd = viewportD, ovx = viewportX, ovy = viewportY; width = tex.width; height = tex.height;