diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2016-11-08 12:27:25 (GMT) |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2016-11-08 12:27:25 (GMT) |
commit | 88e413ba86eb25275fcd47b1886022b2d74b5e37 (patch) | |
tree | 88b5af1ccad5aec8962026c04d8f2301de3a3411 /xlib | |
parent | f3976ba0f67cd4320e02039b9bc3fcdab0bbcc83 (diff) | |
parent | b686d946455e3f361706231cf443cef13572eef1 (diff) | |
download | tk-88e413ba86eb25275fcd47b1886022b2d74b5e37.zip tk-88e413ba86eb25275fcd47b1886022b2d74b5e37.tar.gz tk-88e413ba86eb25275fcd47b1886022b2d74b5e37.tar.bz2 |
(micro-) optimize a few Win32 drawing functions, and make them work when npoints=0
FossilOrigin-Name: 159164e2086ea908dd91bb86cbf81f1bd9dc0902
Diffstat (limited to 'xlib')
-rw-r--r-- | xlib/xgc.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -540,14 +540,15 @@ XDrawPoints( int npoints, int mode) { - int i; - int result = Success; + int res = Success; - for (i=0; (i<npoints) && (result == Success); i++) { - result = XDrawLine(display, d, gc, - points[i].x, points[i].y, points[i].x, points[i].y); + while (npoints-- > 0) { + res = XDrawLine(display, d, gc, + points[0].x, points[0].y, points[0].x, points[0].y); + if (res != Success) break; + ++points; } - return result; + return res; } #if !defined(MAC_OSX_TK) |