resizing an already translated path

35 views
Skip to first unread message

AS

unread,
Feb 6, 2012, 12:35:15 PM2/6/12
to Raphaël
my web App uses raphael. at some point there is a path on my canvas,
that already got translated to another (x,y) location.

i now have a handler, that - when dragged - should resize the height
of my path. my Path has to stay in the same (already translated)
position, but getting its height changed by the delta y (dy) for every
move-function call

here is the code example, showing whats going on: https://gist.github.com/1752694

thanks for any advice



AS

unread,
Feb 7, 2012, 2:47:54 AM2/7/12
to raph...@googlegroups.com
everything that i try results in a jumping behavior of my path.


the path is intentionally translated due to mouse clicks
everything i tried, ends up in one of two results:
- as soon as i try to resize it, it resets/ jumps back to its first location and gets resized there
- as soon as i resize it, it jumps the same translation again and gets resized there 

cant i just say it should do nothing more than stay in position but get translated? 
the reference states, "T x,y" is an absolute translation within a transformation.


AS

unread,
Feb 7, 2012, 4:14:03 AM2/7/12
to Raphaël
is there a way, to just change the x,y,width,height?
i tried element.attr({x: something})
on my path, but it isnt showing any reaction

AS

unread,
Feb 7, 2012, 5:40:38 AM2/7/12
to Raphaël
i worked around it for now, creating a new path per move call, that
takes the transformation matrix into consideration
i guess its not the best approach, but i dont see any other solution
right now

charles thomas

unread,
Feb 7, 2012, 6:00:17 AM2/7/12
to Rap Group
Path is different to other Elements
You can use the transform "Translate" to make coordinate changes and you can use "Scale" to make width and height changes This is standard SVG talk

Raphael wise the problem is reduced because we have the very handy method getBBox. This will tell you the PATH coordinates...


From: AS <obe...@googlemail.com>;
To: Raphaël <raph...@googlegroups.com>;
Subject: Re: resizing an already translated path
Sent: Tue, Feb 7, 2012 9:14:03 AM

is there a way, to just change the x,y,width,height?
i tried element.attr({x: something})
on my path, but it isnt showing any reaction


On 7 Feb., 08:47, AS <ober...@googlemail.com> wrote:
> everything that i try results in a jumping behavior of my path.
>
> the path is intentionally translated due to mouse clicks
> everything i tried, ends up in one of two results:
> - as soon as i try to resize it, it resets/ jumps back to its first
> location and gets resized there
> - as soon as i resize it, it jumps the same translation again and gets
> resized there
>
> cant i just say it should do nothing more than stay in position but get
> translated?
> the reference states, "T x,y" is an absolute translation within a
> transformation.

--
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.

charles thomas

unread,
Feb 7, 2012, 6:02:06 AM2/7/12
to Rap Group
That might mean you suffer a performance hit, depending on what your doing...


From: AS <obe...@googlemail.com>;
To: Raphaël <raph...@googlegroups.com>;
Subject: Re: resizing an already translated path
Sent: Tue, Feb 7, 2012 10:40:38 AM

i worked around it for now, creating a new path per move call, that
takes the transformation matrix into consideration
i guess its not the best approach, but i dont see any other solution
right now


On 7 Feb., 10:14, AS <ober...@googlemail.com> wrote:
Reply all
Reply to author
Forward
0 new messages