* src/raster/ftraster.c (Bezier_Up): Improve joint and loop.
This commit is contained in:
parent
6338f2a681
commit
e9a81e4dd8
|
@ -1151,22 +1151,19 @@
|
||||||
if ( y1 == e )
|
if ( y1 == e )
|
||||||
{
|
{
|
||||||
if ( ras.joint )
|
if ( ras.joint )
|
||||||
{
|
|
||||||
top--;
|
top--;
|
||||||
ras.joint = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*top++ = arc[degree].x;
|
*top++ = arc[degree].x;
|
||||||
|
e += ras.precision;
|
||||||
e += ras.precision;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ras.joint = (Bool)( y2 == e2 );
|
||||||
|
|
||||||
if ( e2 < e )
|
if ( e2 < e )
|
||||||
goto Fin;
|
goto Fin;
|
||||||
|
|
||||||
if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff )
|
if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff )
|
||||||
{
|
{
|
||||||
ras.top = top;
|
|
||||||
ras.error = FT_THROW( Raster_Overflow );
|
ras.error = FT_THROW( Raster_Overflow );
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
@ -1175,8 +1172,6 @@
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ras.joint = FALSE;
|
|
||||||
|
|
||||||
y2 = arc[0].y;
|
y2 = arc[0].y;
|
||||||
x2 = arc[0].x;
|
x2 = arc[0].x;
|
||||||
|
|
||||||
|
@ -1185,7 +1180,6 @@
|
||||||
dy = y2 - arc[degree].y;
|
dy = y2 - arc[degree].y;
|
||||||
dx = x2 - arc[degree].x;
|
dx = x2 - arc[degree].x;
|
||||||
|
|
||||||
|
|
||||||
/* split condition should be invariant of direction */
|
/* split condition should be invariant of direction */
|
||||||
if ( dy > ras.precision_step ||
|
if ( dy > ras.precision_step ||
|
||||||
dx > ras.precision_step ||
|
dx > ras.precision_step ||
|
||||||
|
@ -1197,22 +1191,21 @@
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*top++ = x2 - FMulDiv( y2 - e, dx, dy );
|
*top++ = x2 - FMulDiv( y2 - e, dx, dy );
|
||||||
|
e += ras.precision;
|
||||||
arc -= degree;
|
arc -= degree;
|
||||||
e += ras.precision;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( y2 == e )
|
if ( y2 == e )
|
||||||
{
|
{
|
||||||
ras.joint = TRUE;
|
*top++ = x2;
|
||||||
*top++ = x2;
|
e += ras.precision;
|
||||||
|
|
||||||
e += ras.precision;
|
|
||||||
}
|
}
|
||||||
arc -= degree;
|
arc -= degree;
|
||||||
}
|
}
|
||||||
} while ( arc >= start_arc && e <= e2 );
|
}
|
||||||
|
while ( e <= e2 );
|
||||||
|
|
||||||
Fin:
|
Fin:
|
||||||
ras.top = top;
|
ras.top = top;
|
||||||
|
|
Loading…
Reference in New Issue