diff --git a/glhelper.cpp b/glhelper.cpp index b3952ac..7bad33c 100644 --- a/glhelper.cpp +++ b/glhelper.cpp @@ -106,14 +106,14 @@ void glxVertex3v(Vector u) glVertex3f((GLfloat)u.x, (GLfloat)u.y, (GLfloat)u.z); } -void glxAxisAlignedQuad(double l, double r, double t, double b) +void glxAxisAlignedQuad(double l, double r, double t, double b, bool lone) { - glBegin(GL_QUADS); + if(lone) glBegin(GL_QUADS); glVertex2d(l, t); glVertex2d(l, b); glVertex2d(r, b); glVertex2d(r, t); - glEnd(); + if(lone) glEnd(); } void glxAxisAlignedLineLoop(double l, double r, double t, double b) diff --git a/solvespace.h b/solvespace.h index f9df8fb..ddb71db 100644 --- a/solvespace.h +++ b/solvespace.h @@ -199,7 +199,7 @@ typedef IdList ParamList; // Utility functions that are provided in the platform-independent code. void glxVertex3v(Vector u); -void glxAxisAlignedQuad(double l, double r, double t, double b); +void glxAxisAlignedQuad(double l, double r, double t, double b, bool lone = true); void glxAxisAlignedLineLoop(double l, double r, double t, double b); #define DEFAULT_TEXT_HEIGHT (11.5) #define GLX_CALLBACK __stdcall diff --git a/textwin.cpp b/textwin.cpp index a632a6c..34ed261 100644 --- a/textwin.cpp +++ b/textwin.cpp @@ -704,7 +704,6 @@ bool TextWindow::DrawOrHitTestColorPicker(int how, bool leftDown, glVertex2d(cx, hy); glVertex2d(cx, hym); glEnd(); - glEnd(); } else if(how == CLICK || (how == HOVER && leftDown && editControl.colorPicker.picker1dActive)) { @@ -857,7 +856,7 @@ void TextWindow::Paint(void) { // Move the quad down a bit, so that the descenders // still have the correct background. y += adj; - glxAxisAlignedQuad(x, x + CHAR_WIDTH, y, y + bh); + glxAxisAlignedQuad(x, x + CHAR_WIDTH, y, y + bh, false); y -= adj; } } else if(a == 1) {