Skip to content

Commit 9c7b2b9

Browse files
committed
Fix Orientation not supported in Fit height & Fit width mode
1 parent 0255a55 commit 9c7b2b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cocos2d/core/platform/CCEGLView.js

Lines changed: 8 additions & 0 deletions
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)