Bug 361745 - <svg:image> with negative width/height displaying inverted.

r=jwatt, sr=roc
This commit is contained in:
tor@cs.brown.edu 2007-07-12 08:40:46 -07:00
parent 4a251f7a3a
commit c2407cb71f
2 changed files with 7 additions and 5 deletions

View File

@ -359,7 +359,7 @@ nsSVGImageElement::ConstructPath(gfxContext *aCtx)
GetAnimatedLengthValues(&x, &y, &width, &height, nsnull);
if (width == 0 || height == 0)
if (width <= 0 || height <= 0)
return;
aCtx->Rectangle(gfxRect(x, y, width, height));

View File

@ -249,6 +249,12 @@ nsSVGImageFrame::PaintSVG(nsSVGRenderState *aContext, nsRect *aDirtyRect)
if (!GetStyleVisibility()->IsVisible())
return NS_OK;
float x, y, width, height;
nsSVGElement *element = static_cast<nsSVGElement*>(mContent);
element->GetAnimatedLengthValues(&x, &y, &width, &height, nsnull);
if (width <= 0 || height <= 0)
return NS_OK;
if (!mImageContainer) {
nsCOMPtr<imgIRequest> currentRequest;
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
@ -286,10 +292,6 @@ nsSVGImageFrame::PaintSVG(nsSVGRenderState *aContext, nsRect *aDirtyRect)
GetCanvasTM(getter_AddRefs(ctm));
if (ctm) {
float x, y, width, height;
nsSVGElement *element = static_cast<nsSVGElement*>(mContent);
element->GetAnimatedLengthValues(&x, &y, &width, &height, nsnull);
nsSVGUtils::SetClipRect(gfx, ctm, x, y, width, height);
}
}