Merge pull request from paulkaplan/fix-retina-bubbles

Add an explicit width and height to fix bubbles on retina screens
This commit is contained in:
Paul Kaplan 2018-05-22 09:38:11 -04:00 committed by GitHub
commit d9f2d14306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,8 +157,11 @@ class SVGTextBubble {
_wrapSvgFragment (fragment, width, height) {
let svgString = `<svg xmlns="http://www.w3.org/2000/svg" version="1.1"`;
if (width && height) {
const fullWidth = width + STROKE_WIDTH;
const fullHeight = height + STROKE_WIDTH + 12;
svgString = `${svgString} viewBox="
${-STROKE_WIDTH / 2} ${-STROKE_WIDTH / 2} ${width + STROKE_WIDTH} ${height + STROKE_WIDTH + 12}">`;
${-STROKE_WIDTH / 2} ${-STROKE_WIDTH / 2} ${fullWidth} ${fullHeight}"
width="${fullWidth}" height="${fullHeight}">`;
} else {
svgString = `${svgString}>`;
}