[Vuejs]-Konvajs + vuejs How to save changed height width of elements

0👍

Do you change sizes with Konva.Transformer (https://konvajs.org/docs/vue/Transformer.html)?

If so – Transformer tool doesn’t change width and height directly. Instead, it is changing scaleX and scaleY of a node. So you just need to save that attrs too into a database or change width/height to match new scaling:

const newWidth = rectangle.width() * rectangle.scaleX();
// set new width
rectangle.width(newWidth);

// reset scale:
rectangle.scaleX(1);

Leave a comment