Merge pull request #12782 from xiaofeng11/v3.7-release

UISliderReader and component update
This commit is contained in:
pandamicro 2015-07-13 11:05:59 +08:00
commit 89927c7073
2 changed files with 9 additions and 7 deletions

View File

@ -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)

View File

@ -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);