# Why start drawing in different position from where I clicked

**URL:** https://discourse.threejs.org/t/why-start-drawing-in-different-position-from-where-i-clicked/54759
**Category:** Questions
**Tags:** raycasting
**Created:** [August 8, 2023, 5:47am UTC](https://discourse.threejs.org/t/why-start-drawing-in-different-position-from-where-i-clicked/54759 "2023-08-08T05:47:50Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [August 8, 2023, 9:00am UTC](https://discourse.threejs.org/t/why-start-drawing-in-different-position-from-where-i-clicked/54759/3 "2023-08-08T09:00:08Z")

</div>

Potential solution:

> [@Offset between mouseposition and raycast intersection](https://discourse.threejs.org/t/offset-between-mouseposition-and-raycast-intersection/25568/7):
>
> hi this is to fix mouse coord when the renderer (and its canvas) has a lower size then fullwidth var rect = renderer.domElement.getBoundingClientRect(); mouse.x = ( ( event.clientX - rect.left ) / ( rect.right - rect.left ) ) \* 2 - 1; mouse.y = - ( ( event.clientY - rect.top ) / ( rect.bottom - rect.top) ) \* 2 + 1; I think could solve

---

_[View the full topic](https://discourse.threejs.org/t/why-start-drawing-in-different-position-from-where-i-clicked/54759)._
