Animate cc html5 find original canvas height and width

Community Beginner ,
Apr 15, 2021 Apr 15, 2021

Copy link to clipboard

Copied

I'm looking for a way to get the canvas width and height after having opened the page and posibly resized the page.

 

My publish settings have to be on responsive but I need to get the widht and height my canvas was when it was drawn. If I after opening the page and resizing it simply get the width/height of the canvas by looking at it's current state this won't give me the initial values of width and height but it will return the current height and width.

 

I need to know the width and height it is when its not resized when it's currently resized to place an object on the mouse location after click and for this i need to calculate the ratio between the original size of the canvas and the current size. I can't add the width and the height of my drawing to my script because the width and height can be different and i would like to not have to edit the script each time.

TOPICS
Code

Views

39

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Apr 15, 2021 Apr 15, 2021
Hi.   Use:   lib.properties.width; lib.properties.height;     The essential document properties defined in the FLA are stored in this global var called lib that is created in the publishing process.   Regards, JC

Likes

translate

Translate

Translate
Adobe Community Professional ,
Apr 15, 2021 Apr 15, 2021

Copy link to clipboard

Copied

Hi.

 

Use:

 

lib.properties.width;
lib.properties.height;

 

 

The essential document properties defined in the FLA are stored in this global var called lib that is created in the publishing process.

 

Regards,

JC

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines