relocating change moding by width and height of canvas