diff options
author | Brian Paul <[email protected]> | 2008-04-24 13:36:26 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-04-24 13:36:26 -0600 |
commit | 72c8d2f2449d54005eb721fe3853a6009e9b8d17 (patch) | |
tree | 725d239b740199cfa6ff3bfadb4cf9f3e622e9b6 /src/mesa/main/drawpix.c | |
parent | a770d40c3d4977e2c134661b5d8facaea446b6ea (diff) |
mesa: adjust glBitmap coords by a small epsilon
Fixes problem with bitmaps jumping around by one pixel depending on window
size. The rasterpos is often X.9999 instead of X+1.
Run progs/redbook/drawf and resize window to check.
Diffstat (limited to 'src/mesa/main/drawpix.c')
-rw-r--r-- | src/mesa/main/drawpix.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 0f64f1c1c0c..fa422bb3c76 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -377,8 +377,9 @@ _mesa_Bitmap( GLsizei width, GLsizei height, if (ctx->RenderMode == GL_RENDER) { /* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */ - GLint x = IFLOOR(ctx->Current.RasterPos[0] - xorig); - GLint y = IFLOOR(ctx->Current.RasterPos[1] - yorig); + const GLfloat epsilon = 0.0001; + GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig); + GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig); if (ctx->Unpack.BufferObj->Name) { /* unpack from PBO */ |