EffEPi / fabric.curvedText

Allows you to create curved text - extension to fabric.js
43 stars 41 forks source link

Support for 2.x #49

Open charleswong28 opened 6 years ago

charleswong28 commented 6 years ago

ref: issue 43

ref: issue 26

c-gross commented 6 years ago

Just tested your version for 2.3.3 . It's working but I have one issue. I implemented some position horizontal center method to my text elements whichw as working with old fabric 1.5.0 and is also working in the lastest version. I was working with this curved extension in 1.5.0 but in 2.3.4 and this version of the extension the text is moving a little bit right.

item.set('left', config.pos_x - item.getScaledWidth() * Math.cos(angleRad) / 2);

Any idea why the calculation does not work for this version?

charleswong28 commented 6 years ago

I also realized the padding of the curved text and the sharpness of the text are not the same in 1.x and 2.3.3 version. I believe the text class is modified in fabric 2.x and that's why the result is not the same.

Will look into this later when I have time!