diff --git a/src/pixmap.c b/src/pixmap.c index dd234d6..f620411 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -37,7 +37,7 @@ twin_pixmap_t *twin_pixmap_create(twin_format_t format, pixmap->height = height; twin_matrix_identity(&pixmap->transform); pixmap->clip.left = pixmap->clip.top = 0; - pixmap->clip.right = pixmap->width - 1; + pixmap->clip.right = pixmap->width; pixmap->clip.bottom = pixmap->height; pixmap->origin_x = pixmap->origin_y = 0; pixmap->stride = stride; @@ -67,7 +67,7 @@ twin_pixmap_t *twin_pixmap_create_const(twin_format_t format, pixmap->height = height; twin_matrix_identity(&pixmap->transform); pixmap->clip.left = pixmap->clip.top = 0; - pixmap->clip.right = pixmap->width - 1; + pixmap->clip.right = pixmap->width; pixmap->clip.bottom = pixmap->height; pixmap->origin_x = pixmap->origin_y = 0; pixmap->stride = stride; @@ -231,8 +231,8 @@ void twin_pixmap_clip(twin_pixmap_t *pixmap, pixmap->clip.left = 0; if (pixmap->clip.top < 0) pixmap->clip.top = 0; - if (pixmap->clip.right > pixmap->width - 1) - pixmap->clip.right = pixmap->width - 1; + if (pixmap->clip.right > pixmap->width) + pixmap->clip.right = pixmap->width; if (pixmap->clip.bottom > pixmap->height) pixmap->clip.bottom = pixmap->height; } @@ -269,7 +269,7 @@ void twin_pixmap_reset_clip(twin_pixmap_t *pixmap) { pixmap->clip.left = 0; pixmap->clip.top = 0; - pixmap->clip.right = pixmap->width - 1; + pixmap->clip.right = pixmap->width; pixmap->clip.bottom = pixmap->height; } diff --git a/src/poly.c b/src/poly.c index e966043..b4f9d7d 100644 --- a/src/poly.c +++ b/src/poly.c @@ -213,7 +213,7 @@ static void _span_fill(twin_pixmap_t *pixmap, } /* last pixel */ - if (right & TWIN_POLY_MASK) { + if (right & TWIN_POLY_MASK && x != right) { w = 0; col = 0; while (x < right) {