Skip to content

Commit d2461ee

Browse files
committed
fix(canvas): stop hardcoding inline CSS size on the output canvas
renderDiffToCanvas set canvas.style.width/height to the fixed 1200x675 social-share default. Inline styles win over the stylesheet's responsive `width: 100%` rule, so every generated image forced the card past the viewport on phones and tablets. Sizing the pixel buffer (canvas.width/height) is enough for DPR-crisp rendering; display size is the stylesheet's job.
1 parent 307cbf5 commit d2461ee

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/render/canvas.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ export function renderDiffToCanvas(canvas, segments, options = {}) {
5252

5353
canvas.width = Math.round(width * dpr);
5454
canvas.height = Math.round(height * dpr);
55-
canvas.style.width = `${width}px`;
56-
canvas.style.height = `${height}px`;
5755

5856
const ctx = canvas.getContext("2d");
5957
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);

0 commit comments

Comments
 (0)