From the width and height elements to the viewbox element.

pull/9570/head
Filipe de Lima Brito 8 years ago
parent 44787f5187
commit b09bdfad9b
  1. 2
      server/startup/avatar.js

@ -79,7 +79,7 @@ Meteor.startup(function() {
initials = username.replace(/[^A-Za-z0-9]/g, '').substr(0, 1).toUpperCase();
}
const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"80\" height=\"80\">\n<rect width=\"100%\" height=\"100%\" rx=\"6\" ry=\"6\" fill=\"${ color }\"/>\n<text x=\"50%\" y=\"50%\" dy=\"0.36em\" text-anchor=\"middle\" pointer-events=\"none\" fill=\"#ffffff\" font-family=\"Helvetica, Arial, Lucida Grande, sans-serif\" font-size="50">\n${ initials }\n</text>\n</svg>`;
const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 80 80\">\n<rect width=\"100%\" height=\"100%\" rx=\"6\" ry=\"6\" fill=\"${ color }\"/>\n<text x=\"50%\" y=\"50%\" dy=\"0.36em\" text-anchor=\"middle\" pointer-events=\"none\" fill=\"#ffffff\" font-family=\"Helvetica, Arial, Lucida Grande, sans-serif\" font-size="50">\n${ initials }\n</text>\n</svg>`;
res.write(svg);
res.end();

Loading…
Cancel
Save