Canvas does not render at bigger sizes : is there a maximum size? #269
Unanswered
jeremyallison
asked this question in
Q&A
Replies: 1 comment
-
I had the same issue and decided to dig through the code. On iOS at least, the screen resolution is scaled down from the device resolution, so there's a similar ratio applied to the canvas. You can find the device ratio by doing If you want to draw on something and have the native resolution coordinates, dividing by |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
andreact-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 :
Result :
![Capture d’écran 2021-11-23 à 10 51 13](https://user-images.githubusercontent.com/31436316/143004405-f98f9c8d-e066-4399-9638-de6159b0d7d5.png)
Whereas
Result :
![Capture d’écran 2021-11-23 à 10 51 03](https://user-images.githubusercontent.com/31436316/143004863-656268cb-006d-400d-b4da-0b381ea105c7.png)
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 ? 💡
Beta Was this translation helpful? Give feedback.
All reactions