Skip to content

Commit

Permalink
Add GLYPH_PBF_BORDER constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Sep 12, 2017
1 parent 9bbfb2e commit 6658c47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/style/parse_glyph_pbf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ function readGlyph(tag: number, glyph: Object, pbf: Protobuf) {
module.exports = function (data: ArrayBuffer | Uint8Array): Array<StyleGlyph> {
return new Protobuf(data).readFields(readFontstacks, []);
};

module.exports.GLYPH_PBF_BORDER = border;
5 changes: 3 additions & 2 deletions src/symbol/quads.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow

const Point = require('@mapbox/point-geometry');
const {GLYPH_PBF_BORDER} = require('../style/parse_glyph_pbf');

import type Anchor from './anchor';
import type {PositionedIcon, Shaping} from './shaping';
Expand Down Expand Up @@ -149,9 +150,9 @@ function getGlyphQuads(anchor: Anchor,
const rect = glyph.rect;
if (!rect) continue;

// The rects have an addditional buffer that is not included in their size;
// The rects have an addditional buffer that is not included in their size.
const glyphPadding = 1.0;
const rectBuffer = 3.0 + glyphPadding;
const rectBuffer = GLYPH_PBF_BORDER + glyphPadding;

const halfAdvance = glyph.metrics.advance / 2;

Expand Down

0 comments on commit 6658c47

Please sign in to comment.