Search the web
Sign In
New User? Sign Up
canvas-developers · Canvas Developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Opera and rotate   Message List  
Reply | Forward Message #467 of 493 |
Re: [canvas-developers] Opera and rotate

On Fri, Dec 5, 2008 at 11:45 AM, Richard Heyes <richard.heyes@...> wrote:
> Hi,
>
> Has anyone had any problem with using the rotate() method in
> conjunction with Opera?
>
> Eg: http://dev.rgraph.org/trash/tradar.html
>
> Works fine in Firefox, Chrome and Safari, but not Opera. Cheers.

It looks like the problem you're experiencing is that Opera applies
transforms to paths when it's stroking/filling them, not when you're
constructing the path. So "rotate(); lineTo(); stroke()" is equivalent
(in Opera, not other browsers) to "lineTo(...); rotate(...);
stroke()". That means you can't do "lineTo(); rotate(); lineTo(); ...;
stroke()", because both lines get rotated by exactly the same amount.

(Opera's behaviour used to match the HTML5 canvas specification, but
then the spec changed to match what other browsers did, and Opera
hasn't been fixed yet.)

To make it work in all browsers, you'll probably have to not use
rotate() and instead do the trigonometry manually. I think it should
work if you change the "Thi bit draws the graph" loop to something
like:

for (i in this.data) {
/* ... same as before, then: */

var angle = RGraph.degrees2Radians(360 / this.data.length) * i;
if (i == 0) {
this.context.moveTo(xPos*Math.cos(angle), xPos*Math.sin(angle));
} else {
this.context.lineTo(xPos*Math.cos(angle), xPos*Math.sin(angle));
}
}

--
Philip Taylor
excors@...



Fri Dec 5, 2008 2:15 pm

excors_y
Offline Offline
Send Email Send Email

Forward
Message #467 of 493 |
Expand Messages Author Sort by Date

Hi, Has anyone had any problem with using the rotate() method in conjunction with Opera? Eg: http://dev.rgraph.org/trash/tradar.html Works fine in Firefox,...
Richard Heyes
richard.heyes@...
Send Email
Dec 5, 2008
11:45 am

... It looks like the problem you're experiencing is that Opera applies transforms to paths when it's stroking/filling them, not when you're constructing the...
Philip Taylor
excors_y
Offline Send Email
Dec 5, 2008
2:15 pm

... Seems to work just fine in Opera 10. Cheers /Erik -- Erik Dahlstrom, Core Technology Developer, Opera Software Co-Chair, W3C SVG Working Group Personal...
Erik Dahlström
erida539
Offline Send Email
Dec 5, 2008
2:45 pm

... Hi, Really? I only have Opera 9.6 installed. I think I'll wait for this then instead of hacking (or fumbling...) around. Thanks Eric and Philip. -- Richard...
Richard Heyes
richard.heyes@...
Send Email
Dec 5, 2008
7:20 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help