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

Fix CameraControl pick mouse mis-alignment for scrolled canvas #1488

Closed
xeolabs opened this issue May 15, 2024 · 0 comments · Fixed by xeokit/xeokit-bim-viewer#191
Closed
Milestone

Comments

@xeolabs
Copy link
Member

xeolabs commented May 15, 2024

Issue reported by user:

"For our use-case we’re needing to be able to click on the individual BIM elements and we will have a tool that can display properties for that element when it is selected. I have this enabled, but the issue that I come across is when we are using a smaller screen (like a laptop screen) and the browser window is scrollable and the browser window is scrolled to the bottom, the alignment of the cursor and the canvas element that xeokit uses to render are offset. For our frontend design we cannot have the viewer always full screen since it is only a part of the interface so being able to have this issue resolved is important for our use case."

"This issue seems to be similar except our canvas is on the main page. The canvas height is set to 518px. I have a callback on the hover event from viewer.cameraControl that simply sets the PickResult.entity.highlighted = true . When the window is full screen or when it is scrolled all the way to the top of the page and all the way to the left, when you hover over an entity with the mouse cursor, the entity that is highlighted is the one that is directly under the mouse cursor. If you shrink your browser window so that you can scroll and then scroll down on the main window so that the canvas is shifted up in what is visible, then the entity that is highlighted is above where the mouse cursor is. This is also true for horizontal scrolling. If you shrink the window horizontally and scroll to the right, the entity that is highlighted is to the left of the cursor. This issue also scales with how much you scroll, so if you only scroll down a little bit the offset is small whereas if you scroll a large amount the offset is large"

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

Successfully merging a pull request may close this issue.

1 participant