From b3479214303868fafd107fbd42bc54970036f7b7 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 7 Sep 2018 17:28:22 +0300 Subject: [PATCH] make sure there are no zero-area textures --- src/render/glyph_atlas.js | 2 +- src/render/image_manager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/render/glyph_atlas.js b/src/render/glyph_atlas.js index 885fe46230a..d417850652e 100644 --- a/src/render/glyph_atlas.js +++ b/src/render/glyph_atlas.js @@ -48,7 +48,7 @@ export default class GlyphAtlas { } const {w, h} = potpack(bins); - const image = new AlphaImage({width: w, height: h}); + const image = new AlphaImage({width: w || 1, height: h || 1}); for (const stack in stacks) { const glyphs = stacks[stack]; diff --git a/src/render/image_manager.js b/src/render/image_manager.js index 3b8677174f8..a209a4176df 100644 --- a/src/render/image_manager.js +++ b/src/render/image_manager.js @@ -178,7 +178,7 @@ class ImageManager { const {w, h} = potpack(bins); const dst = this.atlasImage; - dst.resize({width: w, height: h}); + dst.resize({width: w || 1, height: h || 1}); for (const id in this.patterns) { const {bin} = this.patterns[id];