Closed Bug 1129854 Opened 5 years ago Closed 5 years ago

SVG markers not oriented correctly for degenerate beziers

Categories

(Core :: SVG, defect)

35 Branch
x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: paul.lebeau, Assigned: longsonr)

Details

Attachments

(2 files, 3 obsolete files)

Attached image markers_degenerate_CP.svg (obsolete) —
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150122214805

Steps to reproduce:

When the control point vector of a bezier is zero length, the orientation of a marker at that point is being rendered incorrect.  Blink is defaulting to the "slope cannot be determined" behaviour which results in an orientation of 0.

The slope at such a vertex is still determinable, so this degenerate case should be handled correctly.

<svg>
  <defs>
    <marker id="Triangle"
      refX="0" refY="12" markerUnits="userSpaceOnUse"
      markerWidth="24" markerHeight="24" orient="auto">
      <path d="M 0 0 L 24 12 L 0 24 z" />
    </marker>
  </defs>

  <!-- CP vectors are zero.  Orientation should still work. -->

  <path d="M 50,125 C 50,125, 100,25, 100,25" stroke-width="10" stroke="red"
    marker-end="url(#Triangle)" />

  <path d="M 150,125 C 200,25, 200,25, 200,25" stroke-width="10" stroke="red"
    marker-end="url(#Triangle)" />

</svg>





Actual results:

Marker rendered at 0 degrees


Expected results:

Marker rendered at the same orientation as the line
Component: Untriaged → SVG
Product: Firefox → Core
Attachment #8559711 - Attachment is obsolete: true
Forgive the Blink reference.  C&P error.  I reported the same bug in Chrome.
Attached patch degenerate.txt (obsolete) — Splinter Review
Assignee: nobody → longsonr
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8559947 - Flags: review?(jwatt)
Attached patch simplify code (obsolete) — Splinter Review
Attachment #8559947 - Attachment is obsolete: true
Attachment #8559947 - Flags: review?(jwatt)
Attachment #8564534 - Flags: review?(jwatt)
Attachment #8564534 - Attachment is obsolete: true
Attachment #8564534 - Flags: review?(jwatt)
Attachment #8564614 - Flags: review?(jwatt)
Attachment #8564614 - Attachment is patch: true
Attachment #8564614 - Flags: review?(jwatt) → review?(dholbert)
Comment on attachment 8564614 [details] [diff] [review]
without random turbulence change this time

Had meant to r+ this.
Attachment #8564614 - Flags: review?(dholbert) → review+
https://hg.mozilla.org/mozilla-central/rev/04527ab4352c
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.