Skip to content

Commit d24b8a9

Browse files
committed
Closed cocos2d#2429: math.ceil to 0| (x + 0.5)
1 parent 11aec1a commit d24b8a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cocos2d/core/layers/CCLayer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ if (cc._renderType === cc._RENDER_TYPE_CANVAS) {
148148
//compute the bounding box of the bake layer.
149149
this._transformForRenderer();
150150
var boundingBox = this._getBoundingBoxForBake();
151-
boundingBox.width = Math.ceil(boundingBox.width);
152-
boundingBox.height = Math.ceil(boundingBox.height);
151+
boundingBox.width = 0|(boundingBox.width+0.5);
152+
boundingBox.height = 0|(boundingBox.height+0.5);
153153
var bakeContext = locBakeSprite.getCacheContext();
154154
locBakeSprite.resetCanvasSize(boundingBox.width, boundingBox.height);
155155
bakeContext.translate(0 - boundingBox.x, boundingBox.height + boundingBox.y);

0 commit comments

Comments
 (0)