Rect drawing wxh were off by one.

This commit is contained in:
ramiro%netscape.com 1999-07-19 19:12:20 +00:00
parent 6d4424c765
commit 10b1f3c22c

View File

@ -779,10 +779,18 @@ nsRenderingContextXlib::DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord
mTMatrix->TransformCoord(&x,&y,&w,&h);
::XDrawRectangle(mDisplay,
mRenderingSurface->GetDrawable(),
mRenderingSurface->GetGC(),
x,y,w,h);
// Don't draw empty rectangles; also, w/h are adjusted down by one
// so that the right number of pixels are drawn.
if (w && h)
{
::XDrawRectangle(mDisplay,
mRenderingSurface->GetDrawable(),
mRenderingSurface->GetGC(),
x,
y,
w - 1,
h - 1);
}
return NS_OK;
}