Skip to content

Canvas does not render at bigger sizes : is there a maximum size? #244

@jeremyallison

Description

@jeremyallison

For the purposes of my app I need to draw in a pretty big canvas, then pan / zoom the parent container using React native's Animated and react-native-gesture-handler.

I need to draw a kind of map of [x, y] elements.
So of course the total canvas width / height will be x * elementWidth / y * elementHeight

When drawing bigger maps, the canvas simply does not display. I've tried setting fixed values to width / height, and manually decreasing them up to a point where the canvas actually shows.

It seems there is some kind of width / height limitation? But I can't seem to pinpoint how or why.

For example :

canvas.width = 1864;
canvas.height = 1000;

Result :
Capture d’écran 2021-11-23 à 10 51 13

Whereas

canvas.width = 1865; // +1 from previous example 
canvas.height = 1000;

Result :
Capture d’écran 2021-11-23 à 10 51 03

Of course I could reduce the size of each individual item, but they would look more and more blurry with my pinch to zoom interaction.

I've looked up open / closed issues and could not find a similar one yet. Any ideas ? 💡

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions