Skip to content

Commit b22c5ee

Browse files
author
Travis Gesslein
committed
changed how the canvas container is built
1 parent 9c0d631 commit b22c5ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CCBoot.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2463,6 +2463,7 @@ cc.game = /** @lends cc.game# */{
24632463
element = cc.$(el) || cc.$('#' + el),
24642464
localCanvas, localContainer, localConStyle;
24652465

2466+
var innerContainer = document.getElementById("canvasContainer");
24662467
if (element.tagName === "CANVAS") {
24672468
width = width || element.width;
24682469
height = height || element.height;
@@ -2484,7 +2485,9 @@ cc.game = /** @lends cc.game# */{
24842485
element.appendChild(localContainer);
24852486
}
24862487
localContainer.setAttribute('id', 'Cocos2dGameContainer');
2487-
localContainer.appendChild(localCanvas);
2488+
localContainer.appendChild(innerContainer);
2489+
innerContainer.appendChild(localCanvas);
2490+
24882491
this.frame = (localContainer.parentNode === document.body) ? document.documentElement : localContainer.parentNode;
24892492

24902493
localCanvas.addClass("gameCanvas");

0 commit comments

Comments
 (0)