fixes
This commit is contained in:
parent
40a4e181be
commit
d9740908bf
4 changed files with 5 additions and 5 deletions
|
@ -36,7 +36,7 @@ To get field-relative `left` coordinate of the click, we can substract the field
|
|||
let left = event.clientX - fieldCoords.left - field.clientLeft;
|
||||
```
|
||||
|
||||
Normally, `ball.style.position.left` means the "left edge of the element" (the ball). So if we assign that `left`, then the ball edge would be under the mouse cursor.
|
||||
Normally, `ball.style.position.left` means the "left edge of the element" (the ball). So if we assign that `left`, then the ball edge, not center, would be under the mouse cursor.
|
||||
|
||||
We need to move the ball half-width left and half-height up to make it center.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue