diff --git a/js/symbol/bin_pack.js b/js/symbol/bin_pack.js index 51119d71f9a..86fa1d13674 100644 --- a/js/symbol/bin_pack.js +++ b/js/symbol/bin_pack.js @@ -55,7 +55,7 @@ BinPack.prototype.allocate = function(width, height) { if (smallest < 0) { // There's no space left for this char. - return { x: -1, y: -1 }; + return { x: -1, y: -1, w: 0, h: 0 }; } this.free.splice(smallest, 1); diff --git a/js/symbol/sprite_atlas.js b/js/symbol/sprite_atlas.js index 41004b58e5c..f588e542140 100644 --- a/js/symbol/sprite_atlas.js +++ b/js/symbol/sprite_atlas.js @@ -119,6 +119,7 @@ SpriteAtlas.prototype.allocateImage = function(pixelWidth, pixelHeight) { // Add a 1px border around every image. var rect = this.bin.allocate(packWidth, packHeight); if (rect.w === 0) { + console.warn('SpriteAtlas out of space.'); return rect; }