ode>x</code> position of the rectangle to reflect the new canvas size.</p>

    <p>This is fixed in the code below, where the <code>width</code> and <code>height</code> variables are used to dynamically calculate the position of the rectangle. To calculate the <code>x</code> position, we start at the right edge of the canvas (<code>width</code>), then subtract the size of the rectangle (<code>100</code>), and finally subtract the gap we want between the edge of the canvas and the rectangle (<code>25</code>)