Flare-JS icon indicating copy to clipboard operation
Flare-JS copied to clipboard

Color Components don't update

Open umberto-sonnino opened this issue 7 years ago • 1 comments

I've noticed that ColorComponents aren't updating properly in the runtime, as they are not marked dirty on their own.

So for example: a static Rectangle with a gradient fill won't change its color/opacity. On the other hand, if the rectangle is also animating the transform, it'll be updated through the transform dirt flag.

Here's an example file: Simple.Shapes.flr.zip Which is this file.

A solution would be to add a new function to ActorPaint

class ActorPaint extends ActorComponent 
{
[...]
	markDirty()
	{
		this._Actor.addDirt(this, ColorDirty, true);
	}
[...]
}

Which then can be called in Animation.apply() when a ColorComponent is modified. I've tested this locally and it works.

umberto-sonnino avatar Jan 09 '19 11:01 umberto-sonnino

I tried the shapes-2 file in the example and it shows just a blank screen. Is there something additional that needs to be setup to get this to work?

IsaaacD avatar Nov 29 '20 14:11 IsaaacD