flixel-ui icon indicating copy to clipboard operation
flixel-ui copied to clipboard

FlxUIColorSwatchSelecter crashes

Open DleanJeans opened this issue 7 years ago • 2 comments

I simply created it like this:

var colorSwatch = new FlxUIColorSwatchSelecter(50, 400, null, [0xFF0000, 0x00FF00, 0x0000FF]);
add(colorSwatch);

Then it crashes while setting the midTone because the colors is null.

DleanJeans avatar Aug 28 '16 04:08 DleanJeans

This is still broken, FlxUIColorSwatch literally cannot be constructed without failure.

First the Super call in the constructor results in a call to the overriden set_color which assumes colors is not null.

Then even failing that,

if (Colors != null) {
	multiColored = true;
	colors = Colors;
}

Setting multiColored invokes set_multiColored which eventually bubbles down to colorKey() which again assumes that colors is not null.

There's no situation I've been able to find in which this component won't cause a crash.

6J7KZg2f avatar Dec 11 '17 05:12 6J7KZg2f

Sorry for neglecting this for so long -- it started as a component mostly for my own project and I'd forgotten it's technically an official flixel-ui component. Will try to clean it up when I have time.

On Sun, Dec 10, 2017 at 11:17 PM, Skerper [email protected] wrote:

This is still broken, FlxUIColorSwatch literally cannot be constructed without failure.

First the Super call in the constructor results in a call to the overriden set_color which assumes colors is not null.

Then even failing that,

if (Colors != null) { multiColored = true; colors = Colors; }

Setting multiColored invokes set_multiColored which eventually bubbles down to colorKey() which again assumes that colors is not null.

There's no situation I've been able to find in which this component won't cause a crash.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HaxeFlixel/flixel-ui/issues/196#issuecomment-350624809, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtG-CZ5qL902OuI6_dtcA0xiT8gt9ZAks5s_LrzgaJpZM4Ju10Q .

-- www.fortressofdoors.com -- Games, Art, Design

larsiusprime avatar Dec 11 '17 05:12 larsiusprime