mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Fix canvas clipping order.
This commit is contained in:
parent
9e78200cdc
commit
8155af99e0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user