mirror of https://github.com/axmolengine/axmol.git
Merge pull request #12782 from xiaofeng11/v3.7-release
UISliderReader and component update
This commit is contained in:
commit
89927c7073
|
@ -466,7 +466,7 @@ namespace cocostudio
|
|||
auto options = (SliderOptions*)sliderOptions;
|
||||
|
||||
int percent = options->percent();
|
||||
slider->setPercent(percent);
|
||||
//slider->setPercent(percent);
|
||||
|
||||
bool imageFileExist = false;
|
||||
std::string imageErrorFilePath = "";
|
||||
|
@ -798,7 +798,7 @@ namespace cocostudio
|
|||
|
||||
auto widgetReader = WidgetReader::getInstance();
|
||||
widgetReader->setPropsWithFlatBuffers(node, (Table*)options->widgetOptions());
|
||||
|
||||
slider->setPercent(percent);
|
||||
}
|
||||
|
||||
Node* SliderReader::createNodeWithFlatBuffers(const flatbuffers::Table *sliderOptions)
|
||||
|
|
|
@ -553,12 +553,14 @@ void Slider::barRendererScaleChangedWithSize()
|
|||
if (btextureSize.width <= 0.0f || btextureSize.height <= 0.0f)
|
||||
{
|
||||
_barRenderer->setScale(1.0f);
|
||||
return;
|
||||
}
|
||||
float bscaleX = _contentSize.width / btextureSize.width;
|
||||
float bscaleY = _contentSize.height / btextureSize.height;
|
||||
_barRenderer->setScaleX(bscaleX);
|
||||
_barRenderer->setScaleY(bscaleY);
|
||||
else
|
||||
{
|
||||
float bscaleX = _contentSize.width / btextureSize.width;
|
||||
float bscaleY = _contentSize.height / btextureSize.height;
|
||||
_barRenderer->setScaleX(bscaleX);
|
||||
_barRenderer->setScaleY(bscaleY);
|
||||
}
|
||||
}
|
||||
}
|
||||
_barRenderer->setPosition(_contentSize.width / 2.0f, _contentSize.height / 2.0f);
|
||||
|
|
Loading…
Reference in New Issue