Skip to content

Commit 8551888

Browse files
committed
Merge pull request cocos2d#3177 from chengstory/Fix#23745
Fix scrollview rendering error
2 parents e52c981 + 45d0807 commit 8551888

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

extensions/ccui/uiwidgets/scroll-widget/UIScrollView.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ ccui.ScrollView = ccui.Layout.extend(/** @lends ccui.ScrollView# */{
303303
},
304304

305305
_isInContainer: function (widget) {
306+
if(!this._clippingEnabled)
307+
return true;
306308
var wPos = widget._position,
307309
wSize = widget._contentSize,
308310
wAnchor = widget._anchorPoint,
@@ -344,7 +346,7 @@ ccui.ScrollView = ccui.Layout.extend(/** @lends ccui.ScrollView# */{
344346
addChild: function (widget, zOrder, tag) {
345347
if(!widget)
346348
return false;
347-
if(this._clippingEnabled && this._isInContainer(widget) === false)
349+
if(this._isInContainer(widget) === false)
348350
widget._inViewRect = false;
349351
zOrder = zOrder || widget.getLocalZOrder();
350352
tag = tag || widget.getTag();
@@ -417,7 +419,7 @@ ccui.ScrollView = ccui.Layout.extend(/** @lends ccui.ScrollView# */{
417419
this._moveChildPoint.x = locContainer.x + offsetX;
418420
this._moveChildPoint.y = locContainer.y + offsetY;
419421
this._innerContainer.setPosition(this._moveChildPoint);
420-
if(this._clippingEnabled && this._innerContainer._children.length !== 0 )
422+
if(this._innerContainer._children.length !== 0 )
421423
this.updateChildren();
422424
},
423425

extensions/cocostudio/loader/parsers/timelineParser-2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@
469469

470470
this.widgetAttributes(widget, json);
471471

472-
var clipEnabled = json["ClipAble"];
472+
var clipEnabled = json["ClipAble"] || false;
473473
if(clipEnabled != null)
474474
widget.setClippingEnabled(clipEnabled);
475475

@@ -750,7 +750,7 @@
750750
widget.setBackGroundImage(path, type);
751751
});
752752

753-
var clipEnabled = json["ClipAble"];
753+
var clipEnabled = json["ClipAble"] || false;
754754
widget.setClippingEnabled(clipEnabled);
755755

756756
var colorType = getParam(json["ComboBoxIndex"], 0);

0 commit comments

Comments
 (0)