Warm tip: This article is reproduced from stackoverflow.com, please click
canvas fabricjs html javascript html5-canvas

Add objects to FabricJS topContext

发布于 2020-03-30 21:15:28

Trying to draw objects on fabric.js ctx ( to prevent selection / z-index, and make something like rulers at the top of canvas) but after mouse:wheel i see strange stack effect with my drawn object. But on 'selection' event, ctx clears and works fine. Can't understand why mouse:wheel and after:render and other events in fabric.js works so strange and how i can fix this. Thanks!

here's fiddle

Questioner
20yco
Viewed
65
20yco 2020-02-01 14:16

Found solution, just add clearContext method inside before:render in my case

Fiddle