I create group with:
var text = new fabric.Text(textValue,{left: 20, top: 30, fontSize:25});
var rect = new fabric.Rect({
width : text.get('width') + 40,
fill : "#FFFFFF",
height : 100,
stroke : '#000000',
strokeWidth : 1
});
var myGroupObj = new fabric.CustomGroup([ rect,text ], {
left : 0,
top : 0,
});
Now whene I manually resizes my group and I want to get a new heigth.
myGroupObj.get('height')
I have always last one (100). Somme idea to get new height, please?
Instead of accessing the .height
attribute, you should call the getHeight()
function, which gives you the actual height (the one you see on the screen) of a fabric.js object. In the code you have created on jsfiddle, to get the real height, you should change the line alert(activeObject.height);
by alert(activeObject.getHeight());
and you will see the difference.
Cheers, Gonzalo Gabriel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With