haxeui / haxeui-core

The core library of the HaxeUI framework
http://haxeui.org
MIT License
341 stars 71 forks source link

Slider crashes when dragging the thumb #336

Closed krisj07 closed 4 years ago

krisj07 commented 4 years ago

A HSlider crashes immediately when trying to drag the slider thumb. The following exception is shown:

Called from ? line 1 Called from ApplicationMain.hx line 25 Called from ApplicationMain.hx line 130 Called from lime/app/Application.hx line 150 Called from lime/_internal/backend/native/NativeApplication.hx line 146 Called from a C function Called from lime/_internal/backend/native/NativeApplication.hx line 175 Called from lime/_internal/macros/EventMacro.hx line 91 Called from openfl/display/Stage.hx line 2072 Called from openfl/display/Stage.hx line 1253 Called from openfl/display/Stage.hx line 2400 Called from openfl/display/Stage.hx line 1322 Called from openfl/display/Stage.hx line 1422 Called from openfl/display/Stage.hx line 1306 Called from openfl/display/DisplayObject.hx line 1407 Called from a C function Called from openfl/events/EventDispatcher.hx line 402 Called from haxe/ui/backend/ScreenImpl.hx line 180 Called from haxe/ui/core/Screen.hx line 126 Called from haxe/ui/util/EventMap.hx line 70 Called from haxe/ui/components/Slider.hx line 247 Uncaught exception - Invalid operation (-)

Possible Solution

The crash happens on line 247 of Slider.hx and is apparently caused by the _slider.start value being null. However, in a non-range slider, I think _slider.start should be null?

Steps to Reproduce (for bugs)

  1. Define a slider with default values: <hslider />
  2. Run the program openfl test neko
  3. Try to drag the slider thumb

Your Environment

ianharrigan commented 4 years ago

hmmmm... i wonder if this is a regression of somekind... this certainly used to work.

Ill check it out... thanks!

Ian

krisj07 commented 4 years ago

Yep, it's definitely a regression, the same sliders worked fine earlier. I now tested backwards with different haxeui-core versions, and the first version where the crash happens is 1.0.12, and 1.0.11 works normally.

ianharrigan commented 4 years ago

Can we retest this with latest git before i create a release?

Cheers, Ian

krisj07 commented 4 years ago

After updating both haxeui-core and haxeui-openfl to the latest git versions the slider works again. I've retested in the same environment (NekoVM 2.3.0 etc.) as in the original issue report. Thank you for the update!

ianharrigan commented 4 years ago

Great! Thanks, ill create a release shortly.