diff --git a/CHANGELOG.md b/CHANGELOG.md index f1aa4333e..3af1c6e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ All notable changes to this project will be documented in this file. - [#1648] Search - loaded search results mixed - [#1650] Empty search results from history after reloading SWF file - [#1651] FLA Export - mask layers +- [#1532] Rendering - clipping using transparent color ## [14.1.0] - 2021-03-05 ### Added @@ -2117,6 +2118,7 @@ All notable changes to this project will be documented in this file. [#1648]: https://www.free-decompiler.com/flash/issues/1648 [#1650]: https://www.free-decompiler.com/flash/issues/1650 [#1651]: https://www.free-decompiler.com/flash/issues/1651 +[#1532]: https://www.free-decompiler.com/flash/issues/1532 [#1561]: https://www.free-decompiler.com/flash/issues/1561 [#1623]: https://www.free-decompiler.com/flash/issues/1623 [#1622]: https://www.free-decompiler.com/flash/issues/1622 diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java index b89a5e346..4dd3310b8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java @@ -48,6 +48,7 @@ import com.jpexs.decompiler.flash.tags.base.ShapeTag; import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag; import com.jpexs.decompiler.flash.tags.base.TextTag; import com.jpexs.decompiler.flash.types.CLIPACTIONS; +import com.jpexs.decompiler.flash.types.CXFORMWITHALPHA; import com.jpexs.decompiler.flash.types.ColorTransform; import com.jpexs.decompiler.flash.types.MATRIX; import com.jpexs.decompiler.flash.types.RECT; @@ -702,8 +703,21 @@ public class Timeline { img = new SerializableImage(newWidth, newHeight, SerializableImage.TYPE_INT_ARGB_PRE); img.fillTransparent(); + ColorTransform clrTrans2 = clrTrans; + if (clipDepth > -1) { + //Make transparent colors opaque, mask should be only made by shapes + CXFORMWITHALPHA clrMask = new CXFORMWITHALPHA(); + clrMask.hasAddTerms = true; + clrMask.hasMultTerms = true; + clrMask.alphaAddTerm = 255; + clrMask.redMultTerm = 0; + clrMask.greenMultTerm = 0; + clrMask.blueMultTerm = 0; + clrTrans2 = clrMask; + } + if (!(drawable instanceof ImageTag) || (swf.isAS3() && layer.hasImage)) { - drawable.toImage(dframe, time, ratio, renderContext, img, isClip || clipDepth > -1, m, strokeTransform, absMat, clrTrans); + drawable.toImage(dframe, time, ratio, renderContext, img, isClip || clipDepth > -1, m, strokeTransform, absMat, clrTrans2); } else { // todo: show one time warning }