Bug 41412 - [Qt] Canvas arcTo() should draw straight line to p1 if p0, p1 and p2 are collinear
Summary: [Qt] Canvas arcTo() should draw straight line to p1 if p0, p1 and p2 are coll...
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: HTML5, Qt, QtTriaged
Depends on:
Blocks: 35784
  Show dependency treegraph
 
Reported: 2010-06-30 09:29 PDT by Andreas Kling
Modified: 2010-07-02 08:39 PDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (3.28 KB, patch)
2010-06-30 09:32 PDT, Andreas Kling
vestbo: review-
vestbo: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2010-06-30 09:29:28 PDT
If p0, p1 and p2 are all points on a single straight line, arcTo() should draw a straight line from p0 to p1.

Spec link:
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-arcto

This fixes two in-tree tests:
* canvas/philip/tests/2d.path.arcTo.collinear.2.html
* canvas/philip/tests/2d.path.arcTo.collinear.3.html
Comment 1 Andreas Kling 2010-06-30 09:32:25 PDT
Created attachment 60126 [details]
Proposed patch
Comment 2 WebKit Review Bot 2010-06-30 09:34:11 PDT
Attachment 60126 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/platform/graphics/qt/PathQt.cpp:209:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andreas Kling 2010-07-01 11:40:00 PDT
Relevant part of HTML5 spec:

"... if the points (x0, y0), (x1, y1), and (x2, y2) all lie on a single straight line, then the method must add the point (x1, y1) to the subpath, and connect that point to the previous point (x0, y0) by a straight line."

Note that p0 (or (x0, x0)) here refers to the last point in the current subpath.
Comment 4 Tor Arne Vestbø 2010-07-01 12:05:56 PDT
Comment on attachment 60126 [details]
Proposed patch

LGTM
Comment 5 Tor Arne Vestbø 2010-07-01 12:21:39 PDT
Comment on attachment 60126 [details]
Proposed patch

r- for now until we can verify the collinar()
Comment 6 Tor Arne Vestbø 2010-07-02 07:26:42 PDT
Fix for this is coming, preparing patch
Comment 7 Tor Arne Vestbø 2010-07-02 08:24:29 PDT
Landed in http://trac.webkit.org/changeset/62383
Comment 8 Simon Hausmann 2010-07-02 08:34:14 PDT
<cherry-pick-for-backport: r62383>
Comment 9 Simon Hausmann 2010-07-02 08:38:51 PDT
Revision r62383 cherry-picked into qtwebkit-2.0 with commit 13b5b7048431a554e48c4b28235cf206c6a08bf5