Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/swf/exporters/AnimateLibraryExporter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,19 @@ class AnimateLibraryExporter
]);
}

case LineGradientStyle(type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio):
commands = commands.concat([
SWFShapeCommandType.LINE_GRADIENT_STYLE,
type,
colors,
alphas,
ratios,
serializeMatrix(matrix),
spreadMethod,
interpolationMethod,
focalPointRatio
]);

case BeginFill(color, alpha):
commands = commands.concat([SWFShapeCommandType.BEGIN_FILL, color, alpha]);

Expand Down Expand Up @@ -992,6 +1005,19 @@ class AnimateLibraryExporter
]);
}

case LineGradientStyle(type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio):
commands = commands.concat([
SWFShapeCommandType.LINE_GRADIENT_STYLE,
type,
colors,
alphas,
ratios,
serializeMatrix(matrix),
spreadMethod,
interpolationMethod,
focalPointRatio
]);

case BeginFill(color, alpha):
commands = commands.concat([SWFShapeCommandType.BEGIN_FILL, color, alpha]);

Expand Down Expand Up @@ -1541,6 +1567,7 @@ private #if (haxe_ver >= 4.0) enum #end abstract SWFShapeCommandType(Int) from I
public var LINE_STYLE = 6;
public var LINE_TO = 7;
public var MOVE_TO = 8;
public var LINE_GRADIENT_STYLE = 9;
}

#if (haxe_ver < 4.0) @:enum #end
Expand Down
6 changes: 6 additions & 0 deletions src/swf/exporters/ShapeCommandExporter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class ShapeCommandExporter extends DefaultShapeExporter
commands.push(LineStyle(thickness, color, alpha, pixelHinting, scaleMode, startCaps, /*endCaps,*/ joints, miterLimit));
}

override public function lineGradientStyle(type:GradientType, colors:Array<Int>, alphas:Array<Float>, ratios:Array<Int>, matrix:Matrix = null,
spreadMethod:SpreadMethod = null, interpolationMethod:InterpolationMethod = null, focalPointRatio:Float = 0):Void
{
commands.push(LineGradientStyle(type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio));
}

override public function moveTo(x:Float, y:Float):Void
{
commands.push(MoveTo(x, y));
Expand Down
9 changes: 9 additions & 0 deletions src/swf/exporters/animate/AnimateLibrary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ import openfl.filters.GlowFilter;
commands.push(LineStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7],
data[i + 8]));
i += 9;
case LINE_GRADIENT_STYLE:
commands.push(LineGradientStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], __parseMatrix(data[i + 5]), data[i + 6],
data[i + 7], data[i + 8]));
i += 9;
case LINE_TO:
commands.push(LineTo(__pixel(data[i + 1]), __pixel(data[i + 2])));
i += 3;
Expand Down Expand Up @@ -719,6 +723,10 @@ import openfl.filters.GlowFilter;
case LINE_STYLE:
commands.push(LineStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8]));
i += 9;
case LINE_GRADIENT_STYLE:
commands.push(LineGradientStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], __parseMatrix(data[i + 5]), data[i + 6],
data[i + 7], data[i + 8]));
i += 9;
case LINE_TO:
commands.push(LineTo(__pixel(data[i + 1]), __pixel(data[i + 2])));
i += 3;
Expand Down Expand Up @@ -819,6 +827,7 @@ import openfl.filters.GlowFilter;
public var LINE_STYLE = 6;
public var LINE_TO = 7;
public var MOVE_TO = 8;
public var LINE_GRADIENT_STYLE = 9;
}

#if (haxe_ver >= 4.0) enum #else @:enum #end abstract SWFSymbolType(Int) from Int to Int
Expand Down
2 changes: 2 additions & 0 deletions src/swf/exporters/animate/AnimateShapeCommand.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ enum AnimateShapeCommand
EndFill;
LineStyle(thickness:Null<Float>, color:Null<Int>, alpha:Null<Float>, pixelHinting:Null<Bool>, scaleMode:Null<Int> /*LineScaleMode*/,
caps:Null<Int> /*CapsStyle*/, joints:Null<Int> /*JointStyle*/, miterLimit:Null<Float>);
LineGradientStyle(fillType:Null<Int> /*GradientType*/, colors:Array<Int>, alphas:Array<Float>, ratios:Array<Int>, matrix:Matrix,
spreadMethod:Null<Int> /*SpreadMethod*/, interpolationMethod:Null<Int> /*InterpolationMethod*/, focalPointRatio:Float);
LineTo(x:Float, y:Float);
MoveTo(x:Float, y:Float);
}
7 changes: 7 additions & 0 deletions src/swf/exporters/animate/AnimateShapeSymbol.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ class AnimateShapeSymbol extends AnimateSymbol
graphics.lineStyle();
}

case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio):
#if flash
var colors:Array<UInt> = cast colors;
#end
graphics.lineGradientStyle(GradientType.fromInt(fillType), colors, alphas, ratios, matrix, SpreadMethod.fromInt(spreadMethod),
InterpolationMethod.fromInt(interpolationMethod), focalPointRatio);

case LineTo(x, y):
graphics.lineTo(x, y);

Expand Down
2 changes: 2 additions & 0 deletions src/swf/exporters/core/ShapeCommand.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ enum ShapeCommand
EndFill;
LineStyle(thickness:Null<Float>, color:Null<Int>, alpha:Null<Float>, pixelHinting:Null<Bool>, scaleMode:LineScaleMode, caps:CapsStyle, joints:JointStyle,
miterLimit:Null<Float>);
LineGradientStyle(fillType:GradientType, colors:Array<Int>, alphas:Array<Float>, ratios:Array<Int>, matrix:Matrix, spreadMethod:SpreadMethod,
interpolationMethod:InterpolationMethod, focalPointRatio:Float);
LineTo(x:Float, y:Float);
MoveTo(x:Float, y:Float);
}
6 changes: 6 additions & 0 deletions src/swf/exporters/swflite/ShapeSymbol.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ class ShapeSymbol extends SWFSymbol
graphics.lineStyle();
}

case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio):
#if flash
var colors:Array<UInt> = cast colors;
#end
graphics.lineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio);

case LineTo(x, y):
graphics.lineTo(x, y);

Expand Down
6 changes: 6 additions & 0 deletions src/swf/runtime/MorphShape.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class MorphShape extends openfl.display.Shape
graphics.lineStyle();
}

case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio):
#if flash
var colors:Array<UInt> = cast colors;
#end
graphics.lineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio);

case LineTo(x, y):
graphics.lineTo(x, y);

Expand Down
6 changes: 6 additions & 0 deletions src/swf/runtime/Shape.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ class Shape extends openfl.display.Shape
graphics.lineStyle();
}

case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio):
#if flash
var colors:Array<UInt> = cast colors;
#end
graphics.lineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio);

case LineTo(x, y):
graphics.lineTo(x, y);

Expand Down
Loading