summaryrefslogtreecommitdiff
path: root/src/gl_draw.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-03-18 20:14:39 +0100
committerMatthias Melcher <github@matthiasm.com>2023-03-18 20:14:39 +0100
commitf9004352b42b3b039c391d5a8c83930c9b49b53a (patch)
tree43cdc4f9e8773702cf784d980a691229246e1d19 /src/gl_draw.cxx
parent5c482f9d9b357e098f955351f425bc985254ff28 (diff)
Fix gl_rect and OGL::fl_point #688
Diffstat (limited to 'src/gl_draw.cxx')
-rw-r--r--src/gl_draw.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index 35b2007f8..e6adaa1c7 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -216,12 +216,12 @@ void gl_measure(const char* str, int& x, int& y) {
void gl_rect(int x, int y, int w, int h) {
if (w < 0) {w = -w; x = x-w;}
if (h < 0) {h = -h; y = y-h;}
- glBegin(GL_LINE_STRIP);
- glVertex2i(x+w-1, y+h-1);
- glVertex2i(x+w-1, y);
+ glBegin(GL_LINE_LOOP);
+ int r = x+w-1, b = y+h-1;
+ glVertex2i(r, b);
+ glVertex2i(r, y);
glVertex2i(x, y);
- glVertex2i(x, y+h-1);
- glVertex2i(x+w, y+h-1);
+ glVertex2i(x, b);
glEnd();
}