X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ecere%2Fsrc%2Fgfx%2Fdrivers%2FOpenGLDisplayDriver.ec;h=c5c9f8066af6f5f481f62ba01207faef862db8c4;hb=c950cfc276a2837b4fd9913680fec5913dc8e751;hp=026b3fcf58433a05a961536331b5ffada4d79f84;hpb=2089b9433e2fd29a6ee5300e15f2c57377222c0b;p=sdk diff --git a/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec b/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec index 026b3fc..c5c9f80 100644 --- a/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec +++ b/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec @@ -2583,11 +2583,24 @@ class OpenGLDisplayDriver : DisplayDriver glEnd(); } - void DrawLine(Display display, Surface surface, int x1, int y1, int x2, int y2) + void DrawLine(Display display, Surface surface, int _x1, int _y1, int _x2, int _y2) { OGLSurface oglSurface = surface.driverData; - if(x1 == x2) { y2++; y1--; } - else if(y1 == y2) { x2++; x1--; } + float x1 = _x1, x2 = _x2, y1 = _y1, y2 = _y2; + if(_x1 == _x2) + { + if(_y2 >= _y1) + y2 += 1; + else + y1 += 1; + } + else if(_y1 == _y2) + { + if(_x2 >= _x1) + x2 += 1; + else + x1 += 1; + } x1 += surface.offset.x; y1 += surface.offset.y; x2 += surface.offset.x;