Modifying ImageViewReader, UIImageView

This commit is contained in:
pipu 2014-10-11 15:43:37 +08:00
parent 29eb552d00
commit ab969db441
2 changed files with 4 additions and 21 deletions

View File

@ -180,6 +180,8 @@ namespace cocostudio
if (scale9Enable)
{
imageView->setUnifySizeEnabled(false);
imageView->ignoreContentAdaptWithSize(false);
float swf = options.has_scale9width() ? options.scale9width() : 80.0f;
float shf = options.has_scale9height() ? options.scale9height() : 80.0f;

View File

@ -180,7 +180,7 @@ void ImageView::setScale9Enabled(bool able)
_scale9Enabled = able;
_imageRenderer->setScale9Enabled(_scale9Enabled);
if (_scale9Enabled)
{
bool ignoreBefore = _ignoreSize;
@ -191,7 +191,6 @@ void ImageView::setScale9Enabled(bool able)
{
ignoreContentAdaptWithSize(_prevIgnoreSize);
}
setCapInsets(_capInsets);
}
@ -202,20 +201,6 @@ bool ImageView::isScale9Enabled()const
void ImageView::ignoreContentAdaptWithSize(bool ignore)
{
if (_unifySize)
{
if (_scale9Enabled)
{
ProtectedNode::setContentSize(_customSize);
}
else
{
Size s = getVirtualRendererSize();
ProtectedNode::setContentSize(s);
}
onSizeChanged();
return;
}
if (!_scale9Enabled || (_scale9Enabled && !ignore))
{
Widget::ignoreContentAdaptWithSize(ignore);
@ -265,11 +250,7 @@ Node* ImageView::getVirtualRenderer()
void ImageView::imageTextureScaleChangedWithSize()
{
if (_unifySize)
{
_imageRenderer->setPreferredSize(_contentSize);
}
else if (_ignoreSize)
if (_ignoreSize)
{
if (!_scale9Enabled)
{