You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the 2D rendering context is scaled, (here is a reason for scaling) things like .dragAndDrop() fails. Example setup:
letratio=0.8// some value other than 1letcanvas=document.createElement('CANVAS')letcontext=cnv.getContext('2d')document.body.appendChild(canvas)context.scale(ratio,ratio)letoc=oCanvas.create({canvas: canvas})
Since the ratio is different from 1, mouse position in terms of document pixels and mouse position in terms of canvas pixels becomes two separate things, x and y values that transformPointerPosition should be multiplied accordingly, to the context scaling ratio.
The text was updated successfully, but these errors were encountered:
When the 2D rendering context is scaled, (here is a reason for scaling) things like .dragAndDrop() fails. Example setup:
Since the ratio is different from 1, mouse position in terms of document pixels and mouse position in terms of canvas pixels becomes two separate things, x and y values that transformPointerPosition should be multiplied accordingly, to the context scaling ratio.
The text was updated successfully, but these errors were encountered: