diff --git a/package.json b/package.json index 95c1293a397..943259b37ab 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "minimist": "0.0.8", "murmurhash-js": "^1.0.0", "pbf": "^3.0.5", + "potpack": "^1.0.1", "quickselect": "^1.0.0", "rw": "^1.3.3", "supercluster": "^4.1.1", @@ -74,7 +75,6 @@ "pngjs": "^3.0.0", "postcss-cli": "^5.0.0", "postcss-inline-svg": "^3.1.1", - "potpack": "^1.0.1", "pretty-bytes": "^5.1.0", "prismjs": "^1.8.1", "prop-types": "^15.6.0", 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];