Closed dksmiffs closed 11 years ago
Really? Because I just ran QUnit on your latest tests now and all tests passed with no errors:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
Tests completed in 80 milliseconds.
20 assertions of 20 passed, 0 failed.
Here's mine (I've added another test since committing last, but it's still the same one failing). Looks like I've got a slightly older Chromium baseline. I'll see if I can dig up a 23.0 Chromium for Linux, and I'll report back later.
Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.4 (KHTML, like Gecko) Ubuntu/12.10 Chromium/22.0.1229.94 Chrome/22.0.1229.94 Safari/537.4 Tests completed in 136 milliseconds. 20 assertions of 21 passed, 1 failed.
Oh, I forgot that you're on Linux. I believe I know what the issue is now. ;)
Apparently, there is a Chromium-only Linux-only (yes, really) bug which will render an arc invisible if one of its start/end angles is -pi/2 radians. Because jCanvas measures 0 degrees from the top (rather than from the east), you technically end up with a start angle of -90 degrees (or -pi/2 radians). However, because jCanvas does this internally, you interpret the start angle as 0, when it's really -pi/2.
It's an unfortunate (and bizarre) bug which certainly needs to be filed somewhere.
Couldn't find a 23.0 Chromium, but found a 23.0 Chrome (produces same error), looks like it's a Chrome/Chromium Linux-only bug.
Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11 Tests completed in 141 milliseconds. 20 assertions of 21 passed, 1 failed.
I did more testing with drawArc, explicitly specifying start and end values. The only combination I could find of values 2_PI apart that rendered an "invisible" arc was start: 0 radians and end: 2_PI radians. For example, start: -2*PI radians, end: 0 radians works just fine (non-invisible arc).
Related question: is the following the "official" spec we should use to properly understand arc()? http://dev.w3.org/html5/2dcontext/#dom-context-2d-arc
Perhaps, but I don't think an understanding the spec will help to solve the issue here. All browsers except Chromium on Linux seem to implement arc() correctly (because the bug does not occur on these browsers). Therefore, it seems to me as more of a bug rather than a correct implementation that everybody else got wrong.
Therefore, I believe one of us should file an issue on the Chromium bug tracker. If I may suggest, I would suggest that you do so because you experience the issue directly as a Linux user (whereas I use a Mac, and so I can't provide further details regarding the issue).
What do you think? -Caleb
jQuery 1.8.2, jCanvas 200953486485177af3000a40959289682ba44cae, on Chromium 22.0, basic drawArc not working. Same code DOES work on FF 17.0. I will send a pull request with unit test after submitting this issue.