Skip to content

Vectorized Linear Gradients Don't Render Properly #1

@DavisDevelopment

Description

@DavisDevelopment

When working with tannus.graphics.LinearGradient and tannus.graphics.GraphicsPath,
vectorizing the Path will result in failure to properly render the gradient on all targets.
On Java and HTML5, only the first Color is shown, and on Flash, only the last.
Example:

package ;

import tannus.display.Window;
import tannus.graphics.GraphicsPath;
import tannus.graphics.LinearGradient;

class App {
    /* Main Program Function */
    public static function main():Void {
      var w:Window = new Window();
      var g = w.graphics;

      //- Get Path
      var p:GraphicsPath = g.createPath();
      //- Create gradient
      var lg = new LinearGradient([0, 0], [640, 480]);
      lg.addColorStop(0, '#FF0000');
      lg.addColorStop(0, '#0000FF');
      //- Draw Rectangle over entire Window
      p.lineBrush = lg;
      p.rectangle(w.size.toRectangle());
      p.stroke();
      p.vectorize();
      p.draw();
    }
}

I strongly suspect that it's as simple as my vectorization algorithm, but since I'm
very eager to create the asset-management system, and the tannus.graphics.Image class,
I will simply file this issue away for a later date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions