Skip to content

Commit f4a8790

Browse files
committed
Merge pull request cocos2d#1391 from pandamicro/develop
Fixed cocos2d#3371: TMXLayer size set
2 parents ee1e797 + 74f579a commit f4a8790

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cocos2d/tileMap_nodes/CCTMXLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ cc.TMXLayer = cc.SpriteBatchNode.extend(/** @lends cc.TMXLayer# */{
131131

132132
this._cacheContext.translate(0, locCanvas.height);
133133
var locTexContentSize = this._cacheTexture._contentSize;
134-
locTexContentSize.width = locCanvas.width;
135-
locTexContentSize.height = locCanvas.height;
134+
locTexContentSize._width = locCanvas.width;
135+
locTexContentSize._height = locCanvas.height;
136136

137137
// Init sub caches if needed
138138
var totalPixel = locCanvas.width * locCanvas.height;

template/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var cocos2dApp = cc.Application.extend({
6767
cc.FileUtils.getInstance().setSearchResolutionsOrder(resDirOrders);
6868
director.setContentScaleFactor(resourceSize.width / designSize.width);
6969
cc.EGLView.getInstance().setDesignResolutionSize(designSize.width, designSize.height, cc.RESOLUTION_POLICY.SHOW_ALL);
70+
cc.EGLView.getInstance()._resizeWithBrowserSize(true);
7071

7172
// turn on display FPS
7273
director.setDisplayStats(this.config['showFPS']);

0 commit comments

Comments
 (0)