Skip to content

Browser canvas size is overwritten #396

Description

@siikasmaa

When rendering the QR code on a canvas in the browser the existing canvas size is overwritten. This is problematic when rendering more than the QR code in the canvas.

In the file lib/renderer/canvas.js:

function clearCanvas (ctx, canvas, size) {
  ctx.clearRect(0, 0, canvas.width, canvas.height)

  if (!canvas.style) canvas.style = {}
  canvas.height = size
  canvas.width = size
  canvas.style.height = size + 'px'
  canvas.style.width = size + 'px'
}

The function clearCanvas should conditionally set the size for the canvas.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions