Fabric.js How to resize IText horizontally without stretching text

I have this IText object inside the parent Group object.

When I select a group and resize it horizontally (and vertically), IText also resizes, which makes Strech text look awfull.

Now what I would like to do is have the IText center itself (keeping its aspect ratio) inside the group.

How can i do this. I tried to change the width and left side of the IText when the object is scaled, but this did not work.

+4
source share
2 answers

I was not able to complete the last job the fabric.Textboxway I wanted.

, fabric.IText , fabric.Group , fabric.IText . .

:

https://jsfiddle.net/t44wyday/46/

+3

fabricjs (1.6.0.rc1) fabric.IText fabric.Textbox.

, , , , .

+3

Source: https://habr.com/ru/post/1626082/


All Articles