Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in DomElement resize event #1034

Open
robbr2084 opened this issue Jul 31, 2019 · 1 comment
Open

Bug in DomElement resize event #1034

robbr2084 opened this issue Jul 31, 2019 · 1 comment

Comments

@robbr2084
Copy link

The issue is: the domelement is drawn in the correct x,y location only when the browser inner window aspect ratio exactly matches the aspect ratio of the stage. As the browser window is stretched wider and wider, the DomElement is drawn further offset to the left. Same for stretching the window tall. It appears to me that the base x and y values being used are the top and left edges of the window, rather than the top and left edges of the stage. See my sample video below.

For example, if I set the y value of the Domelement to 18, the element is always drawn 18 pixels from the top of the browser window, even when the window is dragged taller and taller. It fails to translate down as the top of the stage moves down in y.

I put up a live demo to try out:
http://pokerdev.darkcloud.com/test/videodemo.html

Drag the aspect ratio of the window to something other than 16:9 and you will see the issue.

@danzen
Copy link
Contributor

danzen commented Mar 17, 2020

We worked through that in ZIM - you can check out the code if it helps: https://zimjs.com/docs.html?item=tag then press the VIEW link at the bottom to see the code. It is a bit of a mess in there but the actual code to solve the issue is in the style of the tag and then the js to move it. Or you can look into using it within ZIM - we have a TextArea, Loader and the generic Tag classes that all do the resizing for you - here is an example: https://zimjs.com/explore/tag.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants