Canvas size constantly growing on lime.embed


#1

Hello!

I found strange behavior when I use lime.embed not in html page start script (I use openfl 8.7.0 and lime 7.2.0)

I mean if I add a html button and handle click with script:
lime.embed ("avatar", "openfl-content", 0, 0, { parameters: {} });
the canvas start constantly growing in height value from 0 to infinity and it never stops.

If I use same script in <body> <script> tag (as it used in default pattern) behavior is normal (not growing).

I set project.xml width and height to 0 to handle window resize.
<window width="0" height="0" antialiasing="0" if="html5" />

and
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

Is there any properties to embed script correctly?


#2

What if you set the CSS for “openfl-content” to have a strict width and height, or at least a percentage?

I bet this is caused by our resizing code, I’m not sure of a good compromise to prevent it on our end, but I’d love to hear ideas


#3

setting up <div> width and height fix the problem
thanks!

also want to thank you for great support


#4

You’re welcome! We might be able to come up with a better solution (default 550 x 400 when there’s no size set?) but for now, you should be able to control your embed size by controlling the CSS of your DIV, and resize it at will :wink: