From 0bd609111a438640b132040c38f9187a023bdbdc Mon Sep 17 00:00:00 2001 From: "dholbert%cs.stanford.edu" Date: Thu, 11 Dec 2008 00:27:03 +0000 Subject: [PATCH] Bug 420697: Add svgGlyphFrame check to GetStrokeDashoffset and GetStrokeDashArray, making them match GetStrokeWidth. r+sr=roc a=dveditz git-svn-id: svn://10.0.0.236/trunk@255481 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/svg/base/src/nsSVGGeometryFrame.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/svg/base/src/nsSVGGeometryFrame.cpp b/mozilla/layout/svg/base/src/nsSVGGeometryFrame.cpp index 52e38b61aeb..25e3f6e657b 100644 --- a/mozilla/layout/svg/base/src/nsSVGGeometryFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGGeometryFrame.cpp @@ -199,6 +199,9 @@ nsSVGGeometryFrame::GetStrokeWidth() nsresult nsSVGGeometryFrame::GetStrokeDashArray(gfxFloat **aDashes, PRUint32 *aCount) { + nsSVGElement *ctx = static_cast + (GetType() == nsGkAtoms::svgGlyphFrame ? + mContent->GetParent() : mContent); *aDashes = nsnull; *aCount = 0; @@ -215,7 +218,7 @@ nsSVGGeometryFrame::GetStrokeDashArray(gfxFloat **aDashes, PRUint32 *aCount) for (PRUint32 i = 0; i < count; i++) { dashes[i] = nsSVGUtils::CoordToFloat(presContext, - static_cast(mContent), + ctx, dasharray[i]); if (dashes[i] < 0.0f) { delete [] dashes; @@ -242,9 +245,13 @@ nsSVGGeometryFrame::GetStrokeDashArray(gfxFloat **aDashes, PRUint32 *aCount) float nsSVGGeometryFrame::GetStrokeDashoffset() { + nsSVGElement *ctx = static_cast + (GetType() == nsGkAtoms::svgGlyphFrame ? + mContent->GetParent() : mContent); + return nsSVGUtils::CoordToFloat(PresContext(), - static_cast(mContent), + ctx, GetStyleSVG()->mStrokeDashoffset); }