From 78b98638bb43ccc0166d163ee7116775ed1eb954 Mon Sep 17 00:00:00 2001 From: "asqueella@gmail.com" Date: Fri, 27 Apr 2007 07:45:21 -0700 Subject: [PATCH] Bug 375909 - nsCanvasRenderingContext2d incorrectly calculates some coordinates (has appunits * appunits, not appunits/appunits)p=Jeremy Lea r+sr=roc --- content/canvas/src/nsCanvasRenderingContext2D.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/canvas/src/nsCanvasRenderingContext2D.cpp b/content/canvas/src/nsCanvasRenderingContext2D.cpp index ed62111ff08..5de0a500bea 100644 --- a/content/canvas/src/nsCanvasRenderingContext2D.cpp +++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp @@ -2667,10 +2667,11 @@ nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, PRInt32 aX, PRInt3 rv = rootFrame->BuildDisplayListForStackingContext(&builder, r, &list); if (NS_SUCCEEDED(rv)) { - float t2p = presContext->AppUnitsPerDevPixel(); + nscoord appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel(); // Ensure that r.x,r.y gets drawn at (0,0) mThebesContext->Save(); - mThebesContext->Translate(gfxPoint(-r.x*t2p, -r.y*t2p)); + mThebesContext->Translate(gfxPoint(-NSAppUnitsToFloatPixels(r.x,appUnitsPerDevPixel), + -NSAppUnitsToFloatPixels(r.y,appUnitsPerDevPixel))); nsIDeviceContext* devCtx = presContext->DeviceContext(); nsCOMPtr rc;