Bug 375909 - nsCanvasRenderingContext2d incorrectly calculates some coordinates (has appunits * appunits, not appunits/appunits)p=Jeremy Lea <reg@freebsd.org>r+sr=roc

This commit is contained in:
asqueella@gmail.com 2007-04-27 07:45:21 -07:00
Родитель 6548e35e34
Коммит 78b98638bb
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -2667,10 +2667,11 @@ nsCanvasRenderingContext2D::DrawWindow(nsIDOMWindow* aWindow, PRInt32 aX, PRInt3
rv = rootFrame->BuildDisplayListForStackingContext(&builder, r, &list); rv = rootFrame->BuildDisplayListForStackingContext(&builder, r, &list);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
float t2p = presContext->AppUnitsPerDevPixel(); nscoord appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
// Ensure that r.x,r.y gets drawn at (0,0) // Ensure that r.x,r.y gets drawn at (0,0)
mThebesContext->Save(); 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(); nsIDeviceContext* devCtx = presContext->DeviceContext();
nsCOMPtr<nsIRenderingContext> rc; nsCOMPtr<nsIRenderingContext> rc;