EffEPi/fabric.curvedText

Loading curvedText via JSON no longer works in fabricJS 1.7.3

Opened this issue · 8 comments

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?

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);
};

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

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

Any suggestions @asturur ?

Thanks!

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 , I also abandoned using it, but then I used the render function of the curvedText class javascript by slightly modifying, and my problem resolved.

@halilozanyilmaz What exactly needs to be changed?

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.