From aa364c0957994e4470c51c19dc6a1897e52f761c Mon Sep 17 00:00:00 2001 From: leovoel Date: Sun, 2 Sep 2018 18:05:15 -0300 Subject: [PATCH] fix: fix cropped output when using Animate CC's camera Animate CC's camera translates the mask of its parent (if there is one) so that the mask's (0, 0) point coincides with its center, and we do set a mask on it, so we end up with cropped output. By setting the mask's position to (0, 0) just before a frame is rendered, this problem is avoided. Closes #1. --- src/com/newgrounds/swivel/swf/SWFRecorder.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/newgrounds/swivel/swf/SWFRecorder.hx b/src/com/newgrounds/swivel/swf/SWFRecorder.hx index 11f53d4..b0a198a 100644 --- a/src/com/newgrounds/swivel/swf/SWFRecorder.hx +++ b/src/com/newgrounds/swivel/swf/SWFRecorder.hx @@ -248,6 +248,11 @@ class SWFRecorder { _window.stage.align = StageAlign.TOP_LEFT; _window.stage.scaleMode = StageScaleMode.NO_SCALE; + // Reset mask position, in case someone changes it by doing something like parent.mask.x = ... + // The camera introduced in Animate CC does that, for example, which results in cropped output (#1). + _mask.x = 0; + _mask.y = 0; + if(recording) { onFrameCaptured.dispatch( drawFrame() ); }