Skip to content

Commit e715f65

Browse files
authored
Merge pull request #3362 from pandamicro/develop
Fix Orientation not supported in Fit height & Fit width mode
2 parents 0255a55 + 9c7b2b9 commit e715f65

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cocos2d/core/platform/CCEGLView.js

+8
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,15 @@ cc.ContentStrategy = cc.Class.extend(/** @lends cc.ContentStrategy# */{
10351035
*/
10361036
var EqualToFrame = cc.ContainerStrategy.extend({
10371037
apply: function (view) {
1038+
var frameH = view._frameSize.height, containerStyle = cc.container.style;
10381039
this._setupContainer(view, view._frameSize.width, view._frameSize.height);
1040+
// Setup container's margin and padding
1041+
if (view._isRotated) {
1042+
containerStyle.marginLeft = frameH + 'px';
1043+
}
1044+
else {
1045+
containerStyle.margin = '0px';
1046+
}
10391047
}
10401048
});
10411049

0 commit comments

Comments
 (0)