Bug 104544 (unpainted horizontal lines in images when scrolling). If we get twip coordinates from layout that aren't on pixel boundaries, round the rect out to make sure we paint everything that we need to. r=pavlov, sr=jag/brendan.

This commit is contained in:
bryner%netscape.com 2002-01-16 04:56:42 +00:00
Родитель 4e61c415e1
Коммит d9b087e808
2 изменённых файлов: 10 добавлений и 8 удалений

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

@ -891,11 +891,12 @@ NS_IMETHODIMP nsRenderingContextImpl::DrawImage(imgIContainer *aImage, const nsR
mTranMatrix->TransformCoord(&pt.x, &pt.y);
sr = *aSrcRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y, &sr.width, &sr.height);
sr.x = aSrcRect->x;
sr.y = aSrcRect->y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
nsCOMPtr<nsIDeviceContext> dc;
GetDeviceContext(*getter_AddRefs(dc));
float t2p;
dc->GetAppUnitsToDevUnits(t2p);
sr.ScaleRoundOut(t2p);
nsCOMPtr<gfxIImageFrame> iframe;
aImage->GetCurrentFrame(getter_AddRefs(iframe));

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

@ -891,11 +891,12 @@ NS_IMETHODIMP nsRenderingContextImpl::DrawImage(imgIContainer *aImage, const nsR
mTranMatrix->TransformCoord(&pt.x, &pt.y);
sr = *aSrcRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y, &sr.width, &sr.height);
sr.x = aSrcRect->x;
sr.y = aSrcRect->y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
nsCOMPtr<nsIDeviceContext> dc;
GetDeviceContext(*getter_AddRefs(dc));
float t2p;
dc->GetAppUnitsToDevUnits(t2p);
sr.ScaleRoundOut(t2p);
nsCOMPtr<gfxIImageFrame> iframe;
aImage->GetCurrentFrame(getter_AddRefs(iframe));