Bug 577475 - polygon end marker should be at the same point as the start marker. r=jwatt

This commit is contained in:
Robert Longson 2010-07-18 10:59:11 +01:00
Родитель b771d2d1d3
Коммит 17a0720c8d
4 изменённых файлов: 32 добавлений и 3 удалений

Просмотреть файл

@ -112,6 +112,10 @@ nsSVGPolygonElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
endMark->angle = nsSVGUtils::AngleBisect(angle, endMark->angle);
startMark->angle = nsSVGUtils::AngleBisect(angle, startMark->angle);
// for a polygon (as opposed to a polyline) there's an implicit extra point
// co-located with the start point that nsSVGPolyElement::GetMarkPoints
// doesn't return
aMarks->AppendElement(nsSVGMark(startMark->x, startMark->y, startMark->angle));
}
}

Просмотреть файл

@ -9,9 +9,11 @@
This test checks that the 'marker' presentation attribute is ignored.
-->
<marker id="marker" markerWidth="40" markerHeight="40" refX="20" refY="20">
<circle cx="20" cy="20" r="20" fill="red"/>
</marker>
<defs>
<marker id="marker" markerWidth="40" markerHeight="40" refX="20" refY="20">
<circle cx="20" cy="20" r="20" fill="red"/>
</marker>
</defs>
<rect width="100%" height="100%" fill="lime"/>
<path d="M20,20 L60,20 L100,20" fill="none" stroke="none" marker="url(#marker)"/>
</svg>

До

Ширина:  |  Высота:  |  Размер: 652 B

После

Ширина:  |  Высота:  |  Размер: 677 B

Просмотреть файл

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/licenses/publicdomain/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Test that marker-start and marker-end are co-located for polygon elements</title>
<!--
From https://bugzilla.mozilla.org/show_bug.cgi?id=577475
This test checks that marker-start and marker-end are co-located for polygon elements.
-->
<defs>
<marker id="markerStart" markerWidth="40" markerHeight="40" refX="20" refY="20">
<rect width="50" height="55" fill="red"/>
</marker>
<marker id="markerEnd" markerWidth="40" markerHeight="40" refX="20" refY="20">
<rect width="50" height="55" fill="lime"/>
</marker>
</defs>
<rect width="100%" height="100%" fill="lime"/>
<polygon marker-start="url(#markerStart)" marker-end="url(#markerEnd)" points="250,150 200,150" />
</svg>

После

Ширина:  |  Высота:  |  Размер: 885 B

Просмотреть файл

@ -124,6 +124,7 @@ fails == inline-in-xul-basic-01.xul pass.svg
== pattern-live-01a.svg pattern-live-01-ref.svg
== pattern-live-01b.svg pattern-live-01-ref.svg
== pattern-live-01c.svg pattern-live-01-ref.svg
== polygon-marker-01.svg pass.svg
== pseudo-classes-01.svg pass.svg
# This test depends on :visited styles (which are asynchronous), so we run
# it in layout/style/test/test_visited_reftests.html instead of using the