Skip to content

Commit 364cf4e

Browse files
linbingquanmrdoob
authored andcommitted
ViewHelper: Fixed container is not defined. (#23605)
1 parent 9059d18 commit 364cf4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/jsm/helpers/ViewHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ class ViewHelper extends THREE.Object3D {
148148
if ( this.animating === true ) return false;
149149

150150
const rect = dom.getBoundingClientRect();
151-
const offsetX = rect.left + ( container.dom.offsetWidth - dim );
152-
const offsetY = rect.top + ( container.dom.offsetHeight - dim );
151+
const offsetX = rect.left + ( dom.offsetWidth - dim );
152+
const offsetY = rect.top + ( dom.offsetHeight - dim );
153153
mouse.x = ( ( event.clientX - offsetX ) / ( rect.width - offsetX ) ) * 2 - 1;
154154
mouse.y = - ( ( event.clientY - offsetY ) / ( rect.bottom - offsetY ) ) * 2 + 1;
155155

0 commit comments

Comments
 (0)