openfl-js icon indicating copy to clipboard operation
openfl-js copied to clipboard

Gradients not displayed from SWF files.

Open kennylerma opened this issue 1 year ago • 0 comments

Describe the bug The Generated createGradientPattern in CanvasGraphics.js expects strings for GradientType and SpreadMethod. The types from SWF are sent as Int

Programatically generated graphic gradients are rendered correctly, but not from SWF

openfl-js/lib/_gen/openfl/display/_internal/CanvasGraphics.js

To Reproduce

  1. Create a Typescript project for OpenFL
  2. Install "swf-loader" and configure plugin.
  3. Load a SWF with shapes having linear and radial gradients and Spread methods for Pad, Reflect and Repeat.
  4. Programatically create shapes with linear and radial gradients and Spread methods for Pad, Reflect and Repeat;
  5. Verify the loaded SWF has missing gradients and programmatic ones do not.

Expected behavior Linear and Radial gradients should be drawn by their requested type. Pad, Reflect and Repeat spread method should be drawn by it's type.

Screenshots If applicable, add screenshots to help explain your problem. Labeled boxes are from the SWF and missing gradient fills. The others are programmatic. Image

OpenFL Targets Open-JS HTML5 target only

Additional context Test Application with FLA OpenFL_Webpack.zip

kennylerma avatar Feb 21 '25 18:02 kennylerma