Problem with freeTransform plugin

95 views
Skip to first unread message

Tobias Åkeblom

unread,
Oct 23, 2012, 11:06:26 AM10/23/12
to Raphaël
I have problem with the freeTransform that is driving me nuts.

The test site is here http://dev.yours.se/liko/survey.html

It is a simple drawing tool that makes a representation of a room. To
add symbols to the drawing, just click on one of the symbols.

When I add say circle, move it, add another circle, move that one and
then add a third circle. Then the third circle's free transform
objects totally loses track of reality

here is the code that adds the object to the paper object.


var img = R.importSVG(svgXML);
img.attr({"stroke":stroke,"stroke-width":1,"fill":fill});

var ft = R.freeTransform(img);

ft.opts.scale = scale;
ft.opts.rotate = rotateObject;
ft.opts.distance = 2;

ft.apply();


I do output some data to the console and there you can see that when
the third item is added to the paper, x and y of the boundingBox has
very strange values. However, if you just add three items without
moving them around. Then this error does not appear. With the
debugging I have made I have come to conclusion that it is something
with getBBox() that fails.

First I thought that it was some global value that is messing with me.
But if it was, shouldn´t it fail as soon as I add the second item??

thanks in advance
Tobias

charles thomas

unread,
Oct 23, 2012, 2:04:50 PM10/23/12
to raph...@googlegroups.com
Did you do some fixing?
I found that dragging a new circle > 3 times OK on Chrome and Firefox but Not OK on IE9...


From: Tobias Åkeblom <tobias....@gmail.com>
To: Raphaël <raph...@googlegroups.com>
Sent: Tuesday, October 23, 2012 4:06:26 PM
Subject: Problem with freeTransform plugin
--
You received this message because you are subscribed to the Google Groups "Raphaël" group.
To post to this group, send an email to raph...@googlegroups.com.
To unsubscribe from this group, send email to raphaeljs+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/raphaeljs?hl=en-GB.



Tobias Åkeblom

unread,
Oct 24, 2012, 2:12:31 AM10/24/12
to Raphaël
Nope, I still se the problem and I have tested chrome, safari and
firefox. When I add the third circle the freetransform-objekt is
missplaced.


On Oct 23, 8:04 pm, charles thomas <charles...@yahoo.com> wrote:
> Did you do some fixing?
> I found that dragging a new circle > 3 times OK on Chrome and Firefox but Not OK on IE9...
>
> ________________________________
>  From: Tobias Åkeblom <tobias.akeb...@gmail.com>
> To: Raphaël <raph...@googlegroups.com>
> Sent: Tuesday, October 23, 2012 4:06:26 PM
> Subject: Problem with freeTransform plugin
>
> I have problem with the freeTransform that is driving me nuts.
>
> The test site is herehttp://dev.yours.se/liko/survey.html
> To unsubscribe from this group, send email to raphaeljs+...@googlegroups.com.

Elbert Alias

unread,
Oct 29, 2012, 9:42:22 PM10/29/12
to raph...@googlegroups.com
Not sure if it's related but you should be setting options with ft.setOpts. The ft.apply function applies changes made to ft.attrs and can cause the strange offset you're seeing.

Tobias Åkeblom

unread,
Nov 6, 2012, 5:17:59 AM11/6/12
to raph...@googlegroups.com
Nope, that didnt make a difference.

I think I have narrow the problem down to the import-svg-library I use. Everything works just fine if I create a simple path:s within the raphael-library. It is when I import my svg:s into the paper things starting to go south. 
Reply all
Reply to author
Forward
0 new messages