You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Behavior: In the OrbitControls.js, specifically the getZoomScale function, the use of the bitwise operator window.devicePixelRatio | 0 causes an issue. When the browser's zoom level changes, and window.devicePixelRatio becomes less than 1, this operation evaluates to 0, leading to the getZoomScale function returning infinity. This results in incorrect camera movement upon mouse wheel operations.
Expected Behavior: Regardless of the window.devicePixelRatio value, the getZoomScale function should return a proper zoom scale, ensuring the camera moves correctly with mouse wheel operations.
Change the browser's zoom level so that window.devicePixelRatio becomes less than 1. The camera jumps to minDistance or maxDistance with a single wheel operation.
Screenshots
No response
Version
v0.160.0
Device
Desktop
Browser
Chrome
OS
MacOS
The text was updated successfully, but these errors were encountered:
The issue related to the getZoomScale function in OrbitControls.js has been resolved in Pull Request #27446. The resolution was confirmed as the problem no longer reproduces in the live demo available here.
Description
OrbitControls.js
, specifically thegetZoomScale
function, the use of the bitwise operatorwindow.devicePixelRatio | 0
causes an issue. When the browser's zoom level changes, andwindow.devicePixelRatio
becomes less than 1, this operation evaluates to 0, leading to thegetZoomScale
function returning infinity. This results in incorrect camera movement upon mouse wheel operations.getZoomScale
function in OrbitControls.jswindow.devicePixelRatio
value, thegetZoomScale
function should return a proper zoom scale, ensuring the camera moves correctly with mouse wheel operations.Reproduction steps
Code
// If window.devicePixelRatio is less than 1, infinity is returned regardless of delta.
Live example
https://threejs.org/examples/#misc_controls_orbit
Change the browser's zoom level so that
window.devicePixelRatio
becomes less than 1. The camera jumps to minDistance or maxDistance with a single wheel operation.Screenshots
No response
Version
v0.160.0
Device
Desktop
Browser
Chrome
OS
MacOS
The text was updated successfully, but these errors were encountered: