ooops draw_scanline clipping
This commit is contained in:
parent
c1b197bc54
commit
36cb8b4eb7
@ -2,6 +2,8 @@
|
||||
*
|
||||
* 27/9/10
|
||||
* - from im_draw_circle()
|
||||
* 17/11/10
|
||||
* - oops, scanline clipping was off by 1
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -56,11 +58,11 @@ im__draw_scanline( Draw *draw, int y, int x1, int x2 )
|
||||
|
||||
g_assert( x1 <= x2 );
|
||||
|
||||
if( y < 0 || y > draw->im->Ysize )
|
||||
if( y < 0 || y >= draw->im->Ysize )
|
||||
return;
|
||||
if( x1 < 0 && x2 < 0 )
|
||||
return;
|
||||
if( x1 > draw->im->Xsize && x2 > draw->im->Xsize )
|
||||
if( x1 >= draw->im->Xsize && x2 >= draw->im->Xsize )
|
||||
return;
|
||||
x1 = IM_CLIP( 0, x1, draw->im->Xsize - 1 );
|
||||
x2 = IM_CLIP( 0, x2, draw->im->Xsize - 1 );
|
||||
|
@ -131,6 +131,8 @@ circle_new( IMAGE *im, int cx, int cy, int radius, gboolean fill, PEL *ink )
|
||||
{
|
||||
Circle *circle;
|
||||
|
||||
if( im_check_coding_known( "im_draw_circle", im ) )
|
||||
return( NULL );
|
||||
if( !(circle = IM_NEW( NULL, Circle )) )
|
||||
return( NULL );
|
||||
if( !im__draw_init( DRAW( circle ), im, ink ) ) {
|
||||
@ -201,9 +203,7 @@ im_draw_circle( VipsImage *image,
|
||||
y + radius >= 0 && y - radius < image->Ysize ) {
|
||||
Circle *circle;
|
||||
|
||||
if( im_check_coding_known( "im_draw_circle", image ) ||
|
||||
!(circle = circle_new( image,
|
||||
x, y, radius, fill, ink )) )
|
||||
if( !(circle = circle_new( image, x, y, radius, fill, ink )) )
|
||||
return( -1 );
|
||||
circle_draw( circle );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user