Skip to content

Bug in DomElement resize event #1034

Open

Description

@robbr2084

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.

Activity

  1. danzen commented on Mar 17, 2020

    @danzen
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions