mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-07-08 12:44:02 -04:00
Merge pull request #291 from paulkaplan/fix-retina-bubbles
Add an explicit width and height to fix bubbles on retina screens
This commit is contained in:
commit
d9f2d14306
1 changed files with 4 additions and 1 deletions
|
@ -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}>`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue