From 587f736a3ff91c75a0edcc56c235aff8757d10f5 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Mon, 3 May 1999 20:48:35 +0000 Subject: [PATCH] Fix small bug in DrawRect and added a comment to help git-svn-id: svn://10.0.0.236/trunk@29977 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp b/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp index 3ef960beeaf..28880ceba1f 100644 --- a/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp +++ b/mozilla/gfx/src/gtk/nsRenderingContextGTK.cpp @@ -712,13 +712,15 @@ NS_IMETHODIMP nsRenderingContextGTK::DrawRect(nscoord aX, nscoord aY, nscoord aW mTMatrix->TransformCoord(&x,&y,&w,&h); - // FIXME why are we drawign this 1 pixel less than we should be? - - ::gdk_draw_rectangle(mSurface->GetDrawable(), mSurface->GetGC(), - FALSE, - x, y, - w - 1, - h - 1); + // 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) { + ::gdk_draw_rectangle(mSurface->GetDrawable(), mSurface->GetGC(), + FALSE, + x, y, + w - 1, + h - 1); + } return NS_OK; }