@@ -28,7 +28,7 @@ twin_pixmap_t *twin_pixmap_create(twin_format_t format,
28
28
pixmap -> height = height ;
29
29
twin_matrix_identity (& pixmap -> transform );
30
30
pixmap -> clip .left = pixmap -> clip .top = 0 ;
31
- pixmap -> clip .right = pixmap -> width ;
31
+ pixmap -> clip .right = pixmap -> width - 1 ;
32
32
pixmap -> clip .bottom = pixmap -> height ;
33
33
pixmap -> origin_x = pixmap -> origin_y = 0 ;
34
34
pixmap -> stride = stride ;
@@ -58,7 +58,7 @@ twin_pixmap_t *twin_pixmap_create_const(twin_format_t format,
58
58
pixmap -> height = height ;
59
59
twin_matrix_identity (& pixmap -> transform );
60
60
pixmap -> clip .left = pixmap -> clip .top = 0 ;
61
- pixmap -> clip .right = pixmap -> width ;
61
+ pixmap -> clip .right = pixmap -> width - 1 ;
62
62
pixmap -> clip .bottom = pixmap -> height ;
63
63
pixmap -> origin_x = pixmap -> origin_y = 0 ;
64
64
pixmap -> stride = stride ;
@@ -222,8 +222,8 @@ void twin_pixmap_clip(twin_pixmap_t *pixmap,
222
222
pixmap -> clip .left = 0 ;
223
223
if (pixmap -> clip .top < 0 )
224
224
pixmap -> clip .top = 0 ;
225
- if (pixmap -> clip .right > pixmap -> width )
226
- pixmap -> clip .right = pixmap -> width ;
225
+ if (pixmap -> clip .right > pixmap -> width - 1 )
226
+ pixmap -> clip .right = pixmap -> width - 1 ;
227
227
if (pixmap -> clip .bottom > pixmap -> height )
228
228
pixmap -> clip .bottom = pixmap -> height ;
229
229
}
@@ -260,7 +260,7 @@ void twin_pixmap_reset_clip(twin_pixmap_t *pixmap)
260
260
{
261
261
pixmap -> clip .left = 0 ;
262
262
pixmap -> clip .top = 0 ;
263
- pixmap -> clip .right = pixmap -> width ;
263
+ pixmap -> clip .right = pixmap -> width - 1 ;
264
264
pixmap -> clip .bottom = pixmap -> height ;
265
265
}
266
266
0 commit comments