So, after some tries.
for HTML5 Gradient Fill
1- rectify CanvasGraphics.hx
in private static function createGradientPattern function :
point = Point.__pool.get ();
point.setTo (0, 0); // <-------------- here.
point2 = Point.__pool.get ();
point2.setTo (100, 0); // <-------------- .
I tried with greater value to see if the gradient was smoother set with higher resolution, without clue.
So I kept 100.
But then, you have to scale your gradientfill with a Matrix xScale calculated for your fill size.
Something like that :
class GradientFill extends Sprite
public function new()
var width = 1920;
var height = 1080;
var matrix:Matrix = new Matrix( width / 100, 0, 0, 1, 0, 0 );
graphics.beginGradientFill( GradientType.LINEAR, [0x0000FF, 0x00FF00], [1, 1], [0, 255], matrix );
graphics.drawRect( 0, 0, width, height );
If I remember well, because a vertical linear gradient is just an oriented ones… or maybe just inverting width/100 by height/100 on the same matrix, and the linear rotation matrix was doing the rest of the job.
So you retrieve well
But at that time, Flash gradient were accurate, weren’t they ?
Now, they are not anymore.
They are weird like Neko/Windows ones.
Any hint where to check ?
I’m losing myself in drawCommanderBuffer/Reader.