EffEPi / fabric.curvedText

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

Loading curvedText via JSON no longer works in fabricJS 1.7.3 #37

Open Lee-Taylor opened 7 years ago

Lee-Taylor commented 7 years ago

Both the following fiddles are exactly the same apart from the version of fabricJS being used.

1.7.2 version: http://jsfiddle.net/yynr4hu2/

1.7.3 version: http://jsfiddle.net/v0djnj5n/

The 1.7.2. version works fine, the 1.7.3. version does not. The saving process seems fine, but when loading the JSON nothing seems to happen.

Looking at the release notes of 1.7.3 ( https://github.com/kangax/fabric.js/releases/tag/v1.7.3 ) it seems that a change to :

"Improvement: Better error managment in loadFromJSON #3586"

may be responsible. Any ideas?

Lee-Taylor commented 7 years ago

OK, I have managed to resolve this issue by modifying fabric.CurvedText.fromObject

Current version :

fabric.CurvedText.fromObject=function (object)
{
        return new fabric.CurvedText(object.text, clone(object));
};

Here is how my version looks now:

fabric.CurvedText.fromObject=function (object, callback)
{
    var newObject = new fabric.CurvedText(object.text, clone(object));
    if(typeof callback !== "undefined")
        callback(newObject, false);
    else
        return(newObject);
};
halilozanyilmaz commented 7 years ago

Hi Lee Taylor,

I believe still the compatibility issue exists, I have made your update, and it text started to show up, but still there is problems. After retrieving back the text, the angle of the text is different, Example:

image

becomes:

image

dpmontero commented 7 years ago

Hi, I corroborate it, there are error from 1.7.3 version.

Any suggestions @asturur ?

Thanks!

asturur commented 7 years ago

curved text was never adopted, i sadly never read the code of it. i plan of implementing it as soon as i can finish the new text, of which just svg export is broken.

so soon.

Lee-Taylor commented 7 years ago

I abandoned using the curvedText plugin for the same reasons as you. I was hoping that the original authors may have had a look, but to no avail.

On Wed, Apr 5, 2017 at 11:41 PM, halilozanyilmaz notifications@github.com wrote:

Hi Lee Taylor,

I believe still the compatibility issue exists, I have made your update, and it text started to show up, but still there is problems. After retrieving back the text, the angle of the text is different, Example:

[image: image] https://cloud.githubusercontent.com/assets/25062864/24730029/e92cd994-1a69-11e7-81de-8e3f17f55b8e.png

becomes:

[image: image] https://cloud.githubusercontent.com/assets/25062864/24730051/ff3e9ff6-1a69-11e7-9a97-00f8101352f7.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EffEPi/fabric.curvedText/issues/37#issuecomment-292018183, or mute the thread https://github.com/notifications/unsubscribe-auth/ALgsv6Kr_Mt4z-xkDOg8SJ8wFwLTd15Aks5rtBi1gaJpZM4L-uYt .

halilozanyilmaz commented 7 years ago

@Lee-Taylor , I also abandoned using it, but then I used the render function of the curvedText class javascript by slightly modifying, and my problem resolved.

Just3F commented 7 years ago

@halilozanyilmaz What exactly needs to be changed?

banver commented 5 years ago

I'm using 1.7.2, still i'm facing issue for loading the curvedText from json, when I load the (enlivenObjects: function) is returning a blank object.