Closed Aratmany closed 10 months ago
Hey - great suggestion! I think this change makes sense for customizing and having better control over the canvas area. Will do some testing and look at merging this change in, thanks for the contribution!
This change was merged in from our upstream repo and should be available in v2.9.2
. Thanks again for the contribution!
I have suggestions to add to the
resizeDrawingSurfaceToCanvas(devicePixelRatio)
method, an optional argument that you can pass a value to.When using the
resizeDrawingSurfaceToCanvas()
=> method when resizing, it takes into account the DPR of the device and multiplies the width and height by that value. That it starts to lag on weak devices, where the difference between smaller and larger canvas resolution is not so great, but the difference in performance is noticeable.if you use resizeDrawingSurfaceToCanvas()
if you use resizeDrawingSurfaceToCanvas(customDPR)
it gives a good performance for weak devices, since the browser doesn't have to render 2x-3x canvas (the difference is almost insignificant to the eye). customDPR (1.5) set increases the width and height of the canvas by 1.5x