Unverified Commit 26780f9b authored by Oleksandr Karpovich's avatar Oleksandr Karpovich Committed by GitHub

js: resetMatrix on canvas before drawing a frame (#439)

It makes canvas to not accumulate previous effects (e.g. scale).
Also, it makes canvas' state consistent with other platforms.
Co-authored-by: 's avatarOleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
parent e68a6d5c
......@@ -63,7 +63,9 @@ abstract class CanvasRenderer constructor(val htmlCanvas: HTMLCanvasElement) {
window.requestAnimationFrame { timestamp ->
redrawScheduled = false
GL.makeContextCurrent(contextPointer)
// `clear` and `resetMatrix` make canvas not accumulate previous effects
canvas?.clear(-1)
canvas?.resetMatrix()
drawFrame(timestamp)
surface?.flushAndSubmit()
context.flush()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment