mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 361745 - <svg:image> with negative width/height displaying inverted.
r=jwatt, sr=roc
This commit is contained in:
parent
4a251f7a3a
commit
c2407cb71f
@ -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));
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user