File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -349,8 +349,8 @@ <h3>4. Time integration</h3>
349349 {
350350 let rect = canvas . getBoundingClientRect ( ) ;
351351 return {
352- x : event . clientX - rect . left ,
353- y : event . clientY - rect . top
352+ x : ( event . clientX - rect . left ) * canvas . width / rect . width ,
353+ y : ( event . clientY - rect . top ) * canvas . height / rect . height
354354 } ;
355355 }
356356
Original file line number Diff line number Diff line change @@ -378,8 +378,8 @@ <h3>4. Time integration</h3>
378378 {
379379 let rect = canvas . getBoundingClientRect ( ) ;
380380 return {
381- x : event . clientX - rect . left ,
382- y : event . clientY - rect . top
381+ x : ( event . clientX - rect . left ) * canvas . width / rect . width ,
382+ y : ( event . clientY - rect . top ) * canvas . height / rect . height
383383 } ;
384384 }
385385
Original file line number Diff line number Diff line change @@ -319,8 +319,8 @@ <h3>Closest point on the surface</h3>
319319 {
320320 let rect = canvas . getBoundingClientRect ( ) ;
321321 return {
322- x : event . clientX - rect . left ,
323- y : event . clientY - rect . top
322+ x : ( event . clientX - rect . left ) * canvas . width / rect . width ,
323+ y : ( event . clientY - rect . top ) * canvas . height / rect . height
324324 } ;
325325 }
326326
@@ -382,7 +382,7 @@ <h3>Closest point on the surface</h3>
382382 else if ( event . touches . length === 2 )
383383 {
384384 // deselect any dragged particle while pinching
385- this . selectedParticle = - 1 ;
385+ this . selected = - 1 ;
386386 const dist = this . getPinchDist ( event ) ;
387387 if ( this . lastPinchDist !== null )
388388 {
Original file line number Diff line number Diff line change @@ -279,8 +279,8 @@ <h3>Closest point on the surface</h3>
279279 {
280280 let rect = canvas . getBoundingClientRect ( ) ;
281281 return {
282- x : event . clientX - rect . left ,
283- y : event . clientY - rect . top
282+ x : ( event . clientX - rect . left ) * canvas . width / rect . width ,
283+ y : ( event . clientY - rect . top ) * canvas . height / rect . height
284284 } ;
285285 }
286286
@@ -342,7 +342,7 @@ <h3>Closest point on the surface</h3>
342342 else if ( event . touches . length === 2 )
343343 {
344344 // deselect any dragged particle while pinching
345- this . selectedParticle = - 1 ;
345+ this . selected = - 1 ;
346346 const dist = this . getPinchDist ( event ) ;
347347 if ( this . lastPinchDist !== null )
348348 {
Original file line number Diff line number Diff line change @@ -633,8 +633,8 @@ <h3>References</h3>
633633 {
634634 let rect = canvas . getBoundingClientRect ( ) ;
635635 return {
636- x : event . clientX - rect . left ,
637- y : event . clientY - rect . top
636+ x : ( event . clientX - rect . left ) * canvas . width / rect . width ,
637+ y : ( event . clientY - rect . top ) * canvas . height / rect . height
638638 } ;
639639 }
640640
You can’t perform that action at this time.
0 commit comments