Should slider:setValue work properly if xScale/yScale set?

Almost certain this is a bug - am I missing something obvious?

Code pasted below and also on GitHub: https://github.com/jflowers45/coronaShare/blob/master/widgetSliderScale/main.lua

local widget = require “widget”

local sliderNotScaled = widget.newSlider {
    id = “sliderNotScaled”,
    width = 100,
    value = 50,
    listener = sliderListener
}

sliderNotScaled.x,sliderNotScaled.y=display.contentWidth/2,display.contentHeight/2
sliderNotScaled:setValue(80)

local sliderScaled = widget.newSlider {
    id = “sliderScaled”,
    width = 100,
    value = 50,
    listener = sliderListener
}

sliderScaled.x,sliderScaled.y=display.contentWidth/2,display.contentHeight/2+100
sliderScaled.xScale,sliderScaled.yScale=0.5,0.5

–the following loine doesn’t work properly
sliderScaled:setValue(80) --should set it to 80% according to http://docs.coronalabs.com/api/type/SliderWidget/setValue.html

Hi @jflowers45,

As pointed out in the documentation, sliders do not support scaling or adjustment via .width and .height, although you can set the width or height in the widget constructor.

http://docs.coronalabs.com/api/library/widget/newSlider.html

So, does :setValue() work on a scaled slider? Probably not. :slight_smile:

Take care,

Brent

So I did miss something obvious :slight_smile:  Thanks

Hi @jflowers45,

As pointed out in the documentation, sliders do not support scaling or adjustment via .width and .height, although you can set the width or height in the widget constructor.

http://docs.coronalabs.com/api/library/widget/newSlider.html

So, does :setValue() work on a scaled slider? Probably not. :slight_smile:

Take care,

Brent

So I did miss something obvious :slight_smile:  Thanks