From 423a698e4f4a92730d7dedfb75ba42a4366d3c3e Mon Sep 17 00:00:00 2001 From: yinkaile <501251991@qq.com> Date: Tue, 5 Jun 2018 11:15:43 +0800 Subject: [PATCH] implement texture bleeding for dynamic atlas (#2728) --- cocos2d/core/renderer/utils/dynamic-atlas/atlas.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/renderer/utils/dynamic-atlas/atlas.js b/cocos2d/core/renderer/utils/dynamic-atlas/atlas.js index 8e90c0348a..e16f3ec84e 100644 --- a/cocos2d/core/renderer/utils/dynamic-atlas/atlas.js +++ b/cocos2d/core/renderer/utils/dynamic-atlas/atlas.js @@ -1,4 +1,4 @@ -const space = 1; +const space = 2; class Atlas { constructor (width, height) { @@ -46,6 +46,11 @@ class Atlas { return false; } + // texture bleeding + this._texture.drawTextureAt(texture, this._x-1, this._y); + this._texture.drawTextureAt(texture, this._x+1, this._y); + this._texture.drawTextureAt(texture, this._x, this._y-1); + this._texture.drawTextureAt(texture, this._x, this._y+1); this._texture.drawTextureAt(texture, this._x, this._y); this._innerTextureInfos[texture._id] = {