Is there a way to get scale to work correctly on rotated objects?

226 views
Skip to first unread message

chris cummings

unread,
Jan 23, 2011, 6:33:07 PM1/23/11
to Raphaël
If I create a rect() or even a path() object in the shape of a
rectangle, rotate it 45 degrees and then try to scale it, it scales as
you would expect *before* the rotation.

So, running:

var s1 = paper.rect(50, 50, 70, 70);
s1.rotate(45, 0, 0).scale(1, .7).translate(100, 0);

doesn't produce an isometric-like view(diamond shape) but instead just
a rectangle at an angle.

Here is image to better illustrate my problem:
http://imgur.com/7GCIM

Best Regards,
Chris

chris cummings

unread,
Jan 25, 2011, 5:34:51 PM1/25/11
to Raphaël
Nothing? Really?

Clifford Heath

unread,
Jan 25, 2011, 5:42:46 PM1/25/11
to raph...@googlegroups.com
On 24/01/2011, at 10:33 AM, chris cummings wrote:
> If I create a rect() or even a path() object in the shape of a
> rectangle, rotate it 45 degrees and then try to scale it, it scales as
> you would expect *before* the rotation.

Apparently there's some new transformation stuff coming in 2.0,
which is a nearly-complete rewrite. Dmitry, can you tell us what
your plans are?

chris cummings

unread,
Jan 25, 2011, 11:52:37 PM1/25/11
to Raphaël
Any idea when 2.0 is supposed to drop? I didn't find anything on the
site or twitter feed about a release date.

Dmitry Baranovskiy

unread,
Jan 26, 2011, 6:27:38 AM1/26/11
to Raphaël
2.0 beta release should be in March. Final release should be in April–
May.

Due to a massive rewrite (over 60%) there are lots of testing.

It’s worth waiting…

On 26 Jan, 15:52, chris cummings <christophermcummi...@gmail.com>
wrote:

Alex Drinkwater

unread,
Jan 26, 2011, 7:46:17 AM1/26/11
to raph...@googlegroups.com
Any hints on what exciting new functions will come with the new version?

a|x

> --
> 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,
Jan 26, 2011, 11:26:42 AM1/26/11
to raph...@googlegroups.com
To Dmitry...
That's all good.

I saw a Twitter message yesterday where you said anyone wanted something in it (2.0)
Tell us now. Just wanted to mention Radial Gradients for paths. I understand you have a new setup for VML?
----------------------------------
Anyway with respect to the person who stareted this subject, sorry this was off topic. Hope yiou found a work around.
Using getBBox to analyse and adjust might be an idea after the initial attempted transform?

Regards Charles


From: Dmitry Baranovskiy <dmitry.ba...@gmail.com>
To: Raphaël <raph...@googlegroups.com>
Sent: Wed, January 26, 2011 6:27:38 AM
Subject: Re: Is there a way to get scale to work correctly on rotated objects?

chris cummings

unread,
Jan 26, 2011, 9:31:11 PM1/26/11
to Raphaël
Charles,

No, no solution yet. =/

Can you elaborate on your suggestion using getBBox?

sittichok chartpongsree

unread,
Jan 27, 2011, 12:02:16 AM1/27/11
to raph...@googlegroups.com
I'm sorry for my language. I'm thai.

This problem need skew transformation more detail in this http://www.propplan.com/#!/projects/propplan/raphaeljs/rotate-and-scale .
I need this transformation too but raphaeljs don't have. If you need skew transformation , please tell Dmitry.

getBBox return size of the object but it return not correct value if path have curve.


2011/1/27 chris cummings <christophe...@gmail.com>
Charles,

No, no solution yet. =/

Can you elaborate on your suggestion using getBBox?
--
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+...@googlegroups.com.

charles thomas

unread,
Jan 27, 2011, 6:28:28 AM1/27/11
to raph...@googlegroups.com
Chris

Here is an interactive example for getBBox
http://www.irunmywebsite.com/raphael/additionalhelp.php?q=getBBox

It worked on all path tests I did (so far)
If your scaleing then the app / Raphael is doing it on the shape? Which is probably to SVG spec?

You might have to write a bespoke solution for skewing and I would use path for that as the primitive equivalent will not be of use?

Regards Charles


From: sittichok chartpongsree <proppl...@gmail.com>
To: raph...@googlegroups.com
Sent: Thu, January 27, 2011 12:02:16 AM

Subject: Re: Is there a way to get scale to work correctly on rotated objects?

sittichok chartpongsree

unread,
Jan 27, 2011, 9:58:46 AM1/27/11
to raph...@googlegroups.com
I sorry for "getBBox return size of the object but it return not correct value if path have curve"
Method getBBox return correct value. I don't use this method so far. Sorry.

2011/1/27 charles thomas <charl...@yahoo.com>
Chris

Here is an interactive example for getBBox
http://www.irunmywebsite.com/raphael/additionalhelp.php?q=getBBox

It worked on all path tests I did (so far)
If your scaleing then the app / Raphael is doing it on the shape? Which is probably to SVG spec?

You might have to write a bespoke solution for skewing and I would use path for that as the primitive equivalent will not be of use?

Regards Charles


From: sittichok chartpongsree <propplan.com@gmail.com>

akkad

unread,
Jan 27, 2011, 2:04:39 PM1/27/11
to Raphaël
For SVG only there is a solution using the group plugin (http://
2hats.net/_box/raphael/grouping.html).
Maybe someone has time to do it for VML too :)



On Jan 27, 4:58 pm, sittichok chartpongsree <propplan....@gmail.com>
wrote:
> I sorry for "getBBox return size of the object but it return not correct
> value if path have curve"
> Method getBBox return correct value. I don't use this method so far. Sorry.
>
> 2011/1/27 charles thomas <charles...@yahoo.com>
>
>
>
>
>
>
>
> > Chris
>
> > Here is an interactive example for getBBox
> >http://www.irunmywebsite.com/raphael/additionalhelp.php?q=getBBox
>
> > It worked on all path tests I did (so far)
> > If your scaleing then the app / Raphael is doing it on the shape? Which is
> > probably to SVG spec?
>
> > You might have to write a bespoke solution for skewing and I would use path
> > for that as the primitive equivalent will not be of use?
>
> > Regards Charles
>
> > ------------------------------
> > *From:* sittichok chartpongsree <propplan....@gmail.com>
> > *To:* raph...@googlegroups.com
> > *Sent:* Thu, January 27, 2011 12:02:16 AM
>
> > *Subject:* Re: Is there a way to get scale to work correctly on rotated
> > objects?
>
> > I'm sorry for my language. I'm thai.
>
> > This problem need skew transformation more detail in this
> >http://www.propplan.com/#!/projects/propplan/raphaeljs/rotate-and-scale<http://www.propplan.com/#%21/projects/propplan/raphaeljs/rotate-and-s...>
> >  .
> > I need this transformation too but raphaeljs don't have. If you need
> > skew transformation , please tell Dmitry.
>
> > getBBox return size of the object but it return not correct value if path
> > have curve.
>
> > 2011/1/27 chris cummings <christophermcummi...@gmail.com>
>
> >> Charles,
>
> >> No, no solution yet. =/
>
> >> Can you elaborate on your suggestion using getBBox?
>
> >> --
> >> 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+...@googlegroups.com<raphaeljs%2Bunsubscribe@googlegroups .com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/raphaeljs?hl=en-GB.
>
> >  --
> > 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+...@googlegroups.com<raphaeljs%2Bunsubscribe@googlegroups .com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/raphaeljs?hl=en-GB.
>
> >  --
> > 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+...@googlegroups.com<raphaeljs%2Bunsubscribe@googlegroups .com>
> > .
Reply all
Reply to author
Forward
0 new messages