EffEPi / fabric.curvedText

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

can't see canvas or access canvas objects after instantiate new curvedText. #4

Closed robgoodliffe closed 10 years ago

robgoodliffe commented 10 years ago

First of all thanks for the plugin. It's been a lifesaver for the application I'm creating.

I'm having a few problems with accessing the canvas or the curved text objects after they've been added. So here's an example of my code.

var canvas = new fabric.StaticCanvas('canvas');

//this works console.log(canvas);

fabric.Image.fromURL('http://url/IMG_0007.jpg', function(oImg) { canvas.add(oImg); });

//still works console.log(canvas);

topLineText = new fabric.CurvedText('Happy Birthday!',{ left: 613, top: 0, textAlign: 'center', fill: '#fff', radius: 414, fontSize: 100, spacing: 6, fontFamily: 'Mystery Quest', strokeWidth: 3, stroke: '#3B3A30' }); canvas.add(topLineText).renderAll();

//breaks here, returns nothing. I'm not sure how i would access the new curved text. console.log(canvas);

//this works to get image oImg = canvas.getObjects()[0];

//but nothing here for text console.log( canvas.getObjects()[1]);

Any help would be appreciated. Thanks

EffEPi commented 10 years ago

Can you please set a jsfiddle with the code so when I will get to it i can test it on on your code and fix the issue .

Please also keep in mind that curvedText is a group or text

robgoodliffe commented 10 years ago

There you go. Thanks for your time.

http://jsfiddle.net/robgoodliffe/ex3NF/43/

robgoodliffe commented 10 years ago

someone has placed a fix for this on the link below. It doesn't mean anything to me but hopefully it will to you.

https://groups.google.com/forum/#!topic/fabricjs/JxFXvF7FJiE

thanks again