# ViewHelper's raycaster have no intersects in HandleClick

**URL:** <https://discourse.threejs.org/t/viewhelpers-raycaster-have-no-intersects-in-handleclick/36472>\
**Category:** Questions\
**Tags:** helpers, view-helper\
**Created:** [March 29, 2022, 2:37am UTC](https://discourse.threejs.org/t/viewhelpers-raycaster-have-no-intersects-in-handleclick/36472 "2022-03-29T02:37:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrogIf](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/frogif/32/25263_2.png) [@FrogIf](https://discourse.threejs.org/u/FrogIf)\
**Post date:** [March 29, 2022, 2:37am UTC](https://discourse.threejs.org/t/viewhelpers-raycaster-have-no-intersects-in-handleclick/36472/1 "2022-03-29T02:37:29Z")

</div>

When I use [ViewHelper](https://github.com/mrdoob/three.js/blob/2f4ab97c16591459ec1af01373cc0f3f3a790e65/examples/jsm/helpers/ViewHelper.js).  
it’s not work well with handleClick function, and I find I can fix the problem:

- The original code:

```javascript
this.handleClick = function ( event ) {
...
			mouse.x = ( ( event.clientX - offsetX ) / ( rect.width - offsetX ) ) * 2 - 1;
			mouse.y = - ( ( event.clientY - offsetY ) / ( rect.bottom - offsetY ) ) * 2 + 1;
...
}

```

- After Fix:

```javascript
this.handleClick = function ( event ) {
...
			mouse.x = ( ( event.clientX - offsetX ) / ( rect.right - offsetX ) ) * 2 - 1;
			mouse.y = - ( ( event.clientY - offsetY ) / ( rect.bottom - offsetY ) ) * 2 + 1;
...
}

```

> just change `rect.width` to `rect.right`

Is this correct? or how to use ViewHelper?
