pixijs / animate-extension

Custom Platform Plugin for Adobe Animate CC (Formerly Adobe Flash CC) - to export animation for the PixiJS renderer
128 stars 25 forks source link

Handle more skew->rotation conversion cases #91

Closed ericente closed 1 year ago

ericente commented 2 years ago

I made a mistake in my previous skew-rotation conversion fix. (#89) That change addressed a particular issue where skew values that we'd expect to see as (-Pi, Pi) actually were coming through as (Pi, Pi) (Pi and -Pi are equivalent values for skew), and I thought there was a mistake in the original code, not realizing that Pixi's skewX is inverted from Animate's skewX.

As far as I know, this new update should handle all cases where skew values can be converted to rotation values. We now handle: skewX === -skewY, skewX === skewY && skewX === Math.PI, and skewX + skewY === 2 * Math.PI.

I'm not sure if it's possible to get skew values that unexpectedly fall outside of the bounds because of rounding errors when comparing to Pi, but I've attempted to reduce this likelihood, and haven't seen it happen in initial tests. If there are failures to convert to rotation, they should still be displayed correctly in the runtime once a correction is published for rotation<->skew tweening.