Subscribe on changes!

vuejs/fabricjs 4.3.0 Issue resizing active object on canvas

avatar
Feb 15th 2021

Version

3.0.5

Reproduction link

https://codesandbox.io/s/fragrant-sky-87umm?file=/src/components/Canvas.vue

Steps to reproduce

When you have assigned a Fabric Canvas to a Vue component and are hovering an active object's corner you cannot resize the object because of the first if statement inside _findTargetCorner.

What is expected?

Resize an active object on the canvas

What is actually happening?

In _findTargetCorner the first if statement does not pass and you cannot resize your active object.


Initial issue raised on fabricjs issue tracker here: https://github.com/fabricjs/fabric.js/issues/6863

avatar
Feb 15th 2021

@asturur

avatar
Feb 15th 2021

Duplicate of https://github.com/vuejs/vue-next/issues/2370, you should use the markRaw:

this.canvas = markRaw(new fabric.Canvas(can));

https://v3.vuejs.org/api/basic-reactivity.html#markraw

avatar
Feb 15th 2021

oh good to know, this will serve as a reference for future fabricJS questions around VUE. Thanks.

avatar
Apr 12th 2021

Today this has been asking again. I think a section on fabricJS docs for interaction with VUE could be good.