title: windowWidth windowHeight not working in iOS
body: <p>I've written a P5JS sketch which is not resizing properly on iPhone13 - it runs fine on other smartphones. On the iPhone it just appears as a tiny sketch a couple of cm wide in the top left corner. Here is the code - the sketch is a fixed ratio in size and always as tall as it can be.</p>
  <p>I think windowWidth, windowHeight are not being properly dealt with by iOS? Or is it a CSS issue, or is it pixelDensity? I'd like to solve this without using jQuery or anything like that.</p>
  <p>Thanks</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
  
      &lt;title&gt;Sketch&lt;/title&gt;
      &lt;script src=&quot;libraries/p5.min.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;libraries/p5.dom.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;mobile.js&quot;&gt;&lt;/script&gt;
      &lt;style&gt;
          body {
              color: #fff;
              background-color: #aaa;
              font: 20px Mono, sans-serif;
          }
          div.sketch {
              position: fixed;
              top:0;
              left:0;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;div id=&quot;sketch&quot;&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <pre><code>function setup() { 
    cnv = createCanvas(450,800); 
    cnv.parent('sketch');
  
    pixelDensity(1);
    windowResized();
  }
  
  
  function windowResized() {
    //the sketch is a fixed ratio and always as tall as can be
    nh = windowHeight;
    nw = nh * 900 / 1600;
    resizeCanvas(nw,nh);
  }
  
  
  function draw() { 
    background(0);
  
    noFill();
    strokeWeight(nh*0.1);
    stroke(255);
    rect(0,0,width,height);
  }  
  </code></pre>