diff --git a/examples/jsm/helpers/ViewHelper.js b/examples/jsm/helpers/ViewHelper.js index 1caf2728653d3b..dd6c8ee3274145 100644 --- a/examples/jsm/helpers/ViewHelper.js +++ b/examples/jsm/helpers/ViewHelper.js @@ -148,8 +148,8 @@ class ViewHelper extends THREE.Object3D { if ( this.animating === true ) return false; const rect = dom.getBoundingClientRect(); - const offsetX = rect.left + ( container.dom.offsetWidth - dim ); - const offsetY = rect.top + ( container.dom.offsetHeight - dim ); + const offsetX = rect.left + ( dom.offsetWidth - dim ); + const offsetY = rect.top + ( dom.offsetHeight - dim ); mouse.x = ( ( event.clientX - offsetX ) / ( rect.width - offsetX ) ) * 2 - 1; mouse.y = - ( ( event.clientY - offsetY ) / ( rect.bottom - offsetY ) ) * 2 + 1;