[SOLVED] Issues with Minimalcomps and Openfl 8.3

I tweeted about this, but at Singmajesty’s request I am also posting on the forums.

It seems there was a change between Openfl 8.2.2 and Openfl 8.3 that caused issues with some of the component rendering in the Haxe port of minimalcomps when targeting HTML5.

For example, some of the slider bars look fine in 8.2.2, but no longer render properly in 8.3. In both versions the Window component doesn’t render properly, but on my work computer it would not render at all.
http://tamarcurry.com/mincomptest/openfl_8_2_2/
http://tamarcurry.com/mincomptest/openfl_8_3_0/

Source code:
http://tamarcurry.com/mincomptest/Main.hx

To be honest, I’m not sure how serious this issue is given that the Minimalcomps library is at 0.9.2 and hasn’t updated in over a year, but I figured I should bring up the issue just in case.

Oh, I should mention this:

Minimalcomps does not work right out of the box without slight modification. The minimalcomps.components.Component class uses an “invalidate()” function that works in Flash but runs into issues with the invalidate function in the Sprite super class when exporting to HTML5. For this reason, I had to rename the function in Component to invalidate2()

UPDATE! Looks like filters are the culprit.

I commented out everywhere filters were set in the Minimalcomps code and now literally every component is working as intended.

Specifically, there’s a function in Component.hx called getShadow that a lot of components were using that seems to not play nice in OpenFL 8.3.

private function getShadow(dist:Float, knockout:Bool = false):DropShadowFilter {
        return new DropShadowFilter(dist, 45, Style.DROPSHADOW, 1, dist, dist, .3, 1, knockout);
}
2 Likes

Thanks! The regression fix is here: https://github.com/openfl/openfl/commit/92790e0d09bec0fd19faf23c86496ef0b3b8d0d8

Your sample really helped :slight_smile:

2 Likes