claus / as3swf

Low level Actionscript 3 library to parse, create, modify and publish SWF files.
MIT License
525 stars 127 forks source link

little careless in com.codeazur.as3swf.data.filters.FilterDropShadow #14

Closed zongwan closed 12 years ago

zongwan commented 12 years ago
    override public function parse(data:SWFData):void {
        dropShadowColor = data.readRGBA();
        blurX = data.readFIXED();
        blurY = data.readFIXED();
        angle = data.readFIXED() ; //  →  angle = data.readFIXED() * 180 /Math.PI;
        distance = data.readFIXED();
        strength = data.readFIXED8();
        var flags:uint = data.readUI8();
        innerShadow = ((flags & 0x80) != 0);
        knockout = ((flags & 0x40) != 0);
        compositeSource = ((flags & 0x20) != 0);
        passes = flags & 0x1f;
    }

effect: get filter can not get correct dropShadowFilter

    override public function get filter():BitmapFilter {
        return new DropShadowFilter(
            distance,
            angle,             // need angle not radian
            ColorUtils.rgb(dropShadowColor),
            ColorUtils.alpha(dropShadowColor),
            blurX,
            blurY,
            strength,
            passes,
            innerShadow,
            knockout
        );
    }

thank you for the amazing project!

sorry for my bad english...

PS:如果你懂得中文... 以下为错误的中文简述:

在com.codeazur.as3swf.data.filters.FilterDropShadow类中

函数parse 读到的angle 是弧度值 在as3 中 DropShadowFilter 使用的是角度值 将angle 换算为角度值 才能得到正确的 BitmapFilter

filter包下的其他类 我没有尝试

感谢你 分享这么棒的 代码

以上问题 是我今天下载的 ZIP 中 遇到的

claus commented 12 years ago

Thanks @zongwan, this is now fixed.