Fix canvas clipping order.

This commit is contained in:
tor%cs.brown.edu 2004-11-25 12:35:33 +00:00
parent 9e78200cdc
commit 8155af99e0

View File

@ -124,6 +124,14 @@ nsSVGCairoCanvas::Init(nsIRenderingContext *ctx,
GDK_WINDOW_XDISPLAY(drawable),
GDK_WINDOW_XWINDOW(drawable));
// get the translation set on the rendering context. It will be in
// displayunits (i.e. pixels*scale), *not* pixels:
nsTransform2D* xform;
mMozContext->GetCurrentTransform(xform);
float dx, dy;
xform->GetTranslation(&dx, &dy);
cairo_translate(mCR, dx, dy);
// clip to dirtyRect
cairo_new_path(mCR);
cairo_move_to(mCR, dirtyRect.x, dirtyRect.y);
@ -133,14 +141,6 @@ nsSVGCairoCanvas::Init(nsIRenderingContext *ctx,
cairo_close_path(mCR);
cairo_clip(mCR);
// get the translation set on the rendering context. It will be in
// displayunits (i.e. pixels*scale), *not* pixels:
nsTransform2D* xform;
mMozContext->GetCurrentTransform(xform);
float dx, dy;
xform->GetTranslation(&dx, &dy);
cairo_translate(mCR, dx, dy);
return NS_OK;
}