@@ -283,6 +283,7 @@ aalines(PyObject *self, PyObject *arg, PyObject *kwargs)
283
283
float x , y ;
284
284
int l , t ;
285
285
int extra_px ;
286
+ int disable_endpoints ;
286
287
int steep_prev ;
287
288
int steep_curr ;
288
289
PyObject * blend = NULL ;
@@ -387,13 +388,15 @@ aalines(PyObject *self, PyObject *arg, PyObject *kwargs)
387
388
fabs (pts_prev [2 ] - pts_prev [0 ]) < fabs (pts_prev [3 ] - pts_prev [1 ]);
388
389
steep_curr = fabs (xlist [2 ] - pts [2 ]) < fabs (ylist [2 ] - pts [1 ]);
389
390
extra_px = steep_prev > steep_curr ;
391
+ disable_endpoints =
392
+ !((roundf (pts [2 ]) == pts [2 ]) && (roundf (pts [3 ]) == pts [3 ]));
390
393
if (closed ) {
391
- draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area , 1 ,
392
- 1 , extra_px );
394
+ draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area ,
395
+ disable_endpoints , disable_endpoints , extra_px );
393
396
}
394
397
else {
395
398
draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area , 0 ,
396
- 1 , extra_px );
399
+ disable_endpoints , extra_px );
397
400
}
398
401
399
402
for (loop = 2 ; loop < length - 1 ; ++ loop ) {
@@ -408,12 +411,14 @@ aalines(PyObject *self, PyObject *arg, PyObject *kwargs)
408
411
fabs (pts_prev [2 ] - pts_prev [0 ]) < fabs (pts_prev [3 ] - pts_prev [1 ]);
409
412
steep_curr = fabs (pts [2 ] - pts [0 ]) < fabs (pts [3 ] - pts [1 ]);
410
413
extra_px = steep_prev != steep_curr ;
414
+ disable_endpoints =
415
+ !((roundf (pts [2 ]) == pts [2 ]) && (roundf (pts [3 ]) == pts [3 ]));
411
416
pts_prev [0 ] = pts [0 ];
412
417
pts_prev [1 ] = pts [1 ];
413
418
pts_prev [2 ] = pts [2 ];
414
419
pts_prev [3 ] = pts [3 ];
415
- draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area , 1 ,
416
- 1 , extra_px );
420
+ draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area ,
421
+ disable_endpoints , disable_endpoints , extra_px );
417
422
}
418
423
419
424
/* Last line - if open, add endpoint pixels. */
@@ -425,17 +430,19 @@ aalines(PyObject *self, PyObject *arg, PyObject *kwargs)
425
430
fabs (pts_prev [2 ] - pts_prev [0 ]) < fabs (pts_prev [3 ] - pts_prev [1 ]);
426
431
steep_curr = fabs (pts [2 ] - pts [0 ]) < fabs (pts [3 ] - pts [1 ]);
427
432
extra_px = steep_prev != steep_curr ;
433
+ disable_endpoints =
434
+ !((roundf (pts [2 ]) == pts [2 ]) && (roundf (pts [3 ]) == pts [3 ]));
428
435
pts_prev [0 ] = pts [0 ];
429
436
pts_prev [1 ] = pts [1 ];
430
437
pts_prev [2 ] = pts [2 ];
431
438
pts_prev [3 ] = pts [3 ];
432
439
if (closed ) {
433
- draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area , 1 ,
434
- 1 , extra_px );
440
+ draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area ,
441
+ disable_endpoints , disable_endpoints , extra_px );
435
442
}
436
443
else {
437
- draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area , 1 ,
438
- 0 , extra_px );
444
+ draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area ,
445
+ disable_endpoints , 0 , extra_px );
439
446
}
440
447
441
448
if (closed && length > 2 ) {
@@ -447,8 +454,10 @@ aalines(PyObject *self, PyObject *arg, PyObject *kwargs)
447
454
fabs (pts_prev [2 ] - pts_prev [0 ]) < fabs (pts_prev [3 ] - pts_prev [1 ]);
448
455
steep_curr = fabs (pts [2 ] - pts [0 ]) < fabs (pts [3 ] - pts [1 ]);
449
456
extra_px = steep_prev != steep_curr ;
450
- draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area , 1 ,
451
- 1 , extra_px );
457
+ disable_endpoints =
458
+ !((roundf (pts [2 ]) == pts [2 ]) && (roundf (pts [3 ]) == pts [3 ]));
459
+ draw_aaline (surf , color , pts [0 ], pts [1 ], pts [2 ], pts [3 ], drawn_area ,
460
+ disable_endpoints , disable_endpoints , extra_px );
452
461
}
453
462
454
463
PyMem_Free (xlist );
0 commit comments