[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] MultiSlider issues
1.
f = FlowView.new;
// random 1 or 0 (integers) - multislider display is empty
x = SCMultiSliderView(f, Rect(0, 0, 300, 100)).value_(Array.fill(10, { 2.rand }));
// random 1.0 or 0.0 (floats) - multislider display is correct
y = SCMultiSliderView(f, Rect(0, 0, 300, 100)).value_(Array.fill(10, { 1.0.rand.round }));
Sometimes I'm using an array that might have 1 or 0 as integers, and it's a bummer to have to convert them to floats manually. Should this be handled in the primitive, or should .asFloat be added to the value_ method?
2. Speaking of value_, you'd think x and y above would be SCMultiSliderViews. They're actually the value arrays, because value_ returns the result of this.setProperty, rather than itself. I'm sure this should be changed -- I'll do it, but I want to make sure it won't break anyone's code.
James
____________________________________
H. James Harkins /// dewdrop_world
http://www.duke.edu/~jharkins
"If attacked by a lion, thrust your arm down his throat.
This takes some practice." -- Cyril Connolly