Patch submisison to reslove label bug in HUISlider and VUISlider

6 views
Skip to first unread message

Jerome

unread,
Feb 11, 2011, 9:42:40 AM2/11/11
to MinimalComps
Hello,

I post a little patch here :
http://code.google.com/p/minimalcomps/issues/detail?id=130

Don't know if it's the better place to submit patchs :)

Thanks,
J.

Keith Peters

unread,
Feb 11, 2011, 12:36:08 PM2/11/11
to minima...@googlegroups.com
Thank you. I'll take a look tonight!
--
---| Keith Peters

Jerome

unread,
Feb 16, 2011, 11:15:50 AM2/16/11
to MinimalComps
Hello,

Finally I propose this version, lighter, simpler (more readable) to
replace my previous patch proposition.
Sorry for the double proposal.

protected function formatValueLabel():void
{
if (isNaN(_slider.value))
{
_valueLabel.text = "NaN";
}
else
{
var mult:Number = Math.pow(10, _precision);
var val:String = (Math.round(_slider.value * mult) /
mult).toString();
var parts:Array = val.split(".");
var i:uint;
if(parts[1] == null)
{
if(_precision > 0)
{
val += ".";
}
for(i; i < _precision; i++)
{
val += "0";
}
}
else if(parts[1].length < _precision)
{
var n:uint = _precision - parts[1].length;
for(i; i < n; i++)
{
val += "0";
}
}
_valueLabel.text = val;
}
positionLabel();
}

On 11 fév, 18:36, Keith Peters <k...@bit-101.com> wrote:
> Thank you. I'll take a look tonight!
>
Reply all
Reply to author
Forward
0 new messages