Skip to content

Commit

Permalink
fix: fix cropped output when using Animate CC's camera
Browse files Browse the repository at this point in the history
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 Herschel#1.
  • Loading branch information
leovoel committed Sep 2, 2018
1 parent 8032fdf commit aa364c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/com/newgrounds/swivel/swf/SWFRecorder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down

0 comments on commit aa364c0

Please sign in to comment.