PointerDragBehaviour picking is off when DOM positioning changes

When I recreate a playground demo https://www.babylonjs-playground.com/#9UFEBE#59 inside my scaffold it works fine. But as soon as it’s positioning changes based on DOM changes around it then mesh picking becomes off target. Same on 4.0 as well as 4.1-alpha20.

See video - PointerDragBehaviour-bug.mp4 | Slack

Just to be sure - what would be the best way to reproduce this? add translation to the canvas? top/left for an absolute positioned element?

Also, another question - are you calling engine.resize() when the canvas size changes?

I failed to recreate a clear reproducible case, but what solved it for me was starting to use engine.getHardwareScalingLevel() when setting the size as well asspecifying 100% width and height in css.

2 Likes