Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Printing text on canvas ends up on different places in browser vs on Android

$
0
0

Hello, I am not sure where to ask the question. Maybe it is Cordova related rather than ionic related, I simply don’t know.

So, in my app I have a canvas element and I print to it using context.fillText(); It works fine, but the problem is that the text ends up on different Y coordinate on browsers and on my phone.

The Canvas height is 1200px and I print the text at 600 px on Y axis. In combination with context.textBaseLine set to 'middle', this should center the text vertically I guess. Well, it does, but only on the Android phone. In the browser, it is shifted very close to the top of the screen.

How come the text ends up so different on the phone and in browsers (I tried Firefox and Chrome)? Something to do with the textBaseline settings?

Thanks

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>