Open Bug 1183702 Opened 9 years ago Updated 2 years ago

Canvas stroke draws wrong line

Categories

(Core :: Graphics: Canvas2D, defect, P3)

39 Branch
x86_64
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: stefan.kranich, Unassigned)

Details

(Whiteboard: [gfx-noted])

Attachments

(7 files)

Attached file Example5.html
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150702232110

Steps to reproduce:

The following HTML page (see attached file) is rendered incorrectly in Firefox.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Canvas stroke draws wrong line</title>
</head>
<body>
<canvas id="test" width="800" height="800"></canvas>
<script type="text/javascript">
var canvas = document.getElementById("test");
var csctx = canvas.getContext("2d");
csctx.beginPath();
csctx.moveTo(-2300, 2200);
csctx.lineTo(2700, -900);
csctx.stroke();
</script>
</body>
</html>

Instead of an ascending line, a horizontal line is drawn on the canvas.

I observe this issue on a 1920x1080 pixels screen. The line is rendered correctly on a 3200x1800 pixels screen, even if I use a smaller resolution on that screen.

I suppose that the incorrect rendering arises if the endpoints of the line are too far outside the screen.


Actual results:

A horizontal line is drawn on the canvas.


Expected results:

An ascending line should be drawn on the canvas.
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Attached image bug1183702.png
Tested:
Windows 7 - Firefox 39.0, Firefox 42.0a1, Chrome 43.0, and Internet Explorer
Windows 10 - Firefox 39.0, Firefox 42.0a1, Chrome 43.0, and Internet Explorer
Fedora 21 - Firefox 39.0, Firefox 42.0a1, and Chrome 43.0

In all of the above tested environments the testcase renders a line going diagonally up and to the right for me (see attachment). My apologies if I misunderstood the bug but it doesn't seem I can reproduce it as described. Can you provide any more information?
Attached image Example5.png
Screenshot of incorrectly drawn line
I can only reproduce the issue on one machine (running Arch linux). GPU is Geforce 730M with latest nvidia drivers.
(In reply to stefan.kranich from comment #3)
> I can only reproduce the issue on one machine (running Arch linux). GPU is
> Geforce 730M with latest nvidia drivers.

A few things you could try:
* Check older versions of Firefox: http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/
* Check if it happens with the Nouveau driver
* Check if it happens with an older nVidia driver
* Check if it happens with another Linux distribution on your system

This will help pinpoint the root cause of your issue.
> A few things you could try:
> * Check older versions of Firefox:
> http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/

Same with Firefox 26.0 and Firefox 10.0.1.

> * Check if it happens with the Nouveau driver

Yes.

> * Check if it happens with an older nVidia driver

Yes.

> * Check if it happens with another Linux distribution on your system

Works under Ubuntu 12.04.2 with Firefox 18 and Firefox 39.0.

It also works under Arch linux with Chromium 43.0.2357.134 and uzbl-browser 2012.05.14.

> This will help pinpoint the root cause of your issue.
I'm not sure what to say other than there seems to be some sort of conflict between your Arch system and Firefox. Your results above seem to indicate this is not a regression in a recent Firefox update. Basically what this points to is some difference between your Arch setup and your Ubuntu setup that affects Firefox but not Chrome.

I'll have to leave this to people with more technical expertise of Canvas to advise you further.
Hello,

i can confirm this bug on Fedora 22 with Firefox 44.0.2. I guess it has something to do with hidpi, since i can't reproduce the bug on my other machine with a lodpi screen.
Attached image ffdrawingbug.png
Attached file xdpyinfo.txt
Attached file xorg.log
Attached file xrdb.txt
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: