简体   繁体   中英

Fabric.js stop responding in chrome at start

I have created a photo editor using fabric.js, but when I launch my web page at localhost and add a photo to the canvas, the resizing and movements of the photo don't respond at all. But when I click "Inspect element" and close it, everything starts working normally. I don't understand what's the problem here? Every timec I have to open "Inspect element" once to make canvas respond.

A little help would be greatly appreciated!

I have came across the same problem. My work around is:

  • After adding the element to the canvas, render the canvas by doing: canvas.renderAll();
  • Then calculate the offset by doing: canvas.calcOffset();

It works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM