Skip to content
Snippets Groups Projects
Commit 4633d63c authored by Greg Fodor's avatar Greg Fodor
Browse files

Compensate for layout differences between SVG and DOM by adding some canvas padding

parent f29c62c5
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,8 @@ function ChatMessage(props) { ...@@ -29,8 +29,8 @@ function ChatMessage(props) {
const style = isEmoji ? presenceLogPureEmojiStyle : presenceLogSpawnedStyle; const style = isEmoji ? presenceLogPureEmojiStyle : presenceLogSpawnedStyle;
// Scale by 12x // Scale by 12x
messageCanvas.width = (el.offsetWidth + 33) * 12; messageCanvas.width = (el.offsetWidth + 33) * 12.1;
messageCanvas.height = (el.offsetHeight + 17) * 12; messageCanvas.height = (el.offsetHeight + 17) * 12.1;
const xhtml = encodeURIComponent(` const xhtml = encodeURIComponent(`
<svg xmlns="http://www.w3.org/2000/svg" width="${messageCanvas.width}" height="${messageCanvas.height}"> <svg xmlns="http://www.w3.org/2000/svg" width="${messageCanvas.width}" height="${messageCanvas.height}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment