u/micr0chasm

Canvas scaling issue

I have been having a persistent issue regarding the scaling of my canvas in an HTML Canvas project. The document is set to 1800x800 px, but when I test it, it opens in the browser at 1620x720.

In addition, I’ve had all sorts of issues with finding the locations of things on the canvas. Things like finding the location of the center of the screen, local to global position translation, placing an object at the location of a mouseclick— none of it works correctly. It often seems offset by some amount and it seems that the issues could be caused by the canvas scaling.

In the example of finding the center of the screen, I’ve found that canvas.width and canvas.height do not work correctly, but lib.properties.width and lib.properties.height do work correctly. Maybe that is a clue?

I am quite new to Adobe Animate and I might just be doing things incorrectly, but I was hoping that there was some well-known issue here that can be fixed.

Any help would be appreciated.

reddit.com
u/micr0chasm — 2 days ago