Skip to content

Preserve lineGradientStyle in SWF shape exports#54

Open
Tutez64 wants to merge 3 commits into
openfl:masterfrom
Tutez64:bugfix/line-gradient-style-export
Open

Preserve lineGradientStyle in SWF shape exports#54
Tutez64 wants to merge 3 commits into
openfl:masterfrom
Tutez64:bugfix/line-gradient-style-export

Conversation

@Tutez64
Copy link
Copy Markdown
Contributor

@Tutez64 Tutez64 commented May 29, 2026

SWFShape.export() already emits lineGradientStyle(...) for LINESTYLE2 records that use a gradient fill, but ShapeCommandExporter inherited the no-op implementation from DefaultShapeExporter. As a result, Animate/SWFLite exports kept the base lineStyle but lost the gradient stroke data.

This adds LineGradientStyle to shape commands and wires it through:

  • ShapeCommandExporter
  • Animate serialization/deserialization
  • Animate shape rendering
  • SWFLite shape rendering

SWFLineGradientStyleExportRepro.zip

@Tutez64
Copy link
Copy Markdown
Contributor Author

Tutez64 commented May 29, 2026

Added LineGradientStyle handling in:

  • swf.runtime.Shape
  • swf.runtime.MorphShape

Both now forward the command to graphics.lineGradientStyle(...), matching the Animate and SWFLite renderers and fixing the test failures.

Also fixed the AIR/Flash error by casting line gradient color arrays to Array<UInt> under #if flash, matching the existing beginGradientFill handling. I applied the same cast to the Animate and SWFLite render paths so LineGradientStyle behaves consistently across exporters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant