Bug 692203 - Covered region must be empty if markerHeight or markerWidth=0. r=dholbert

This commit is contained in:
Robert Longson 2011-10-06 20:03:16 +01:00
parent 2fb55f3b09
commit 6c0b658f8e
4 changed files with 18 additions and 2 deletions

View File

@ -221,6 +221,14 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const gfxMatrix &aToBBoxUserspace,
AutoMarkerReferencer markerRef(this, aMarkedFrame);
nsSVGMarkerElement *content = static_cast<nsSVGMarkerElement*>(mContent);
const nsSVGViewBoxRect viewBox = content->GetViewBoxRect();
if (viewBox.width <= 0.0f || viewBox.height <= 0.0f) {
return gfxRect();
}
mStrokeWidth = aStrokeWidth;
mX = aMark->x;
mY = aMark->y;
@ -228,8 +236,6 @@ nsSVGMarkerFrame::GetMarkBBoxContribution(const gfxMatrix &aToBBoxUserspace,
gfxRect bbox;
nsSVGMarkerElement *content = static_cast<nsSVGMarkerElement*>(mContent);
gfxMatrix markerTM =
content->GetMarkerTransform(mStrokeWidth, mX, mY, mAutoAngle);
gfxMatrix viewBoxTM = content->GetViewBoxTransform();

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<marker id="marker" markerWidth="0"/>
<path d="M0,0 L100,100 200,200" marker-mid="url(#marker)"/>
</svg>

After

Width:  |  Height:  |  Size: 150 B

View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg">
<marker id="marker" markerHeight="0"/>
<path d="M0,0 L100,100 200,200" marker-mid="url(#marker)"/>
</svg>

After

Width:  |  Height:  |  Size: 151 B

View File

@ -116,3 +116,5 @@ load 657077-1.svg
load 669025-1.svg
load 669025-2.svg
load 682411-1.svg
load 692203-1.svg
load 692203-2.svg