I’ve created a Codepen with an example of a canvas inside an Ionic tab. It’s pretty straightforward. The canvas border is in red and you’ll notice a black line going across the canvas. The code that is drawing the line is in the .controller at the bottom of the JavaScript.
Not really i have the canvas in html but it is not being loaded some of the time i get a canvas is null error and other times when i reload it will appear fine. Ionic appears to be delaying the loading of the script im using to populate the canvas whenever i wrap it in a ion-nav element.
Is there any convenience function for the Javascript to know the ‘free’ drawing space available to a canvas,
without using a fixed canvas width and height? Something like window.innerWidth and
window.innerHeight functions, but removing any other UI items that are laid out inside the window
around the canvas?