Canvas stroke draws wrong line

UNCONFIRMED
Unassigned

Status

()

P3
normal
UNCONFIRMED
3 years ago
9 months ago

People

(Reporter: stefan.kranich, Unassigned)

Tracking

39 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gfx-noted])

Attachments

(7 attachments)

(Reporter)

Description

3 years ago
Created attachment 8633547 [details]
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.
(Reporter)

Updated

3 years ago
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Created attachment 8633561 [details]
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?
(Reporter)

Comment 2

3 years ago
Created attachment 8634115 [details]
Example5.png

Screenshot of incorrectly drawn line
(Reporter)

Comment 3

3 years ago
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.
(Reporter)

Comment 5

3 years ago
> 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.

Comment 7

3 years ago
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.

Comment 8

3 years ago
Created attachment 8726117 [details]
ffdrawingbug.png

Comment 9

3 years ago
Created attachment 8726118 [details]
xdpyinfo.txt

Comment 10

3 years ago
Created attachment 8726119 [details]
xorg.log

Comment 11

3 years ago
Created attachment 8726120 [details]
xrdb.txt
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.