Bug 483439 - text with stroke and fill causes crashes. r+sr=roc

This commit is contained in:
Robert Longson 2009-03-16 11:59:23 +00:00
parent 944580803e
commit cd32c05a9c

View File

@ -449,11 +449,11 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
nsRefPtr<gfxContext> tmpCtx = MakeTmpCtx(); nsRefPtr<gfxContext> tmpCtx = MakeTmpCtx();
SetMatrixPropagation(PR_FALSE); SetMatrixPropagation(PR_FALSE);
CharacterIterator iter(this, PR_TRUE);
gfxRect extent = gfxRect(0, 0, 0, 0); gfxRect extent = gfxRect(0, 0, 0, 0);
if (SetupCairoStrokeGeometry(tmpCtx)) { if (SetupCairoStrokeGeometry(tmpCtx)) {
CharacterIterator iter(this, PR_TRUE);
gfxFloat strokeWidth = tmpCtx->CurrentLineWidth(); gfxFloat strokeWidth = tmpCtx->CurrentLineWidth();
AddCharactersToPath(&iter, tmpCtx); AddCharactersToPath(&iter, tmpCtx);
tmpCtx->SetLineWidth(strokeWidth); tmpCtx->SetLineWidth(strokeWidth);
@ -461,6 +461,7 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
extent = tmpCtx->GetUserStrokeExtent(); extent = tmpCtx->GetUserStrokeExtent();
} }
if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None) { if (GetStyleSVG()->mFill.mType != eStyleSVGPaintType_None) {
CharacterIterator iter(this, PR_TRUE);
AddBoundingBoxesToPath(&iter, tmpCtx); AddBoundingBoxesToPath(&iter, tmpCtx);
tmpCtx->IdentityMatrix(); tmpCtx->IdentityMatrix();
extent = extent.Union(tmpCtx->GetUserPathExtent()); extent = extent.Union(tmpCtx->GetUserPathExtent());