From 8077f1094ba5dc5b01423db35e6b495c3e20c0c2 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Sun, 11 Oct 1998 14:07:01 +0000 Subject: [PATCH] Yet another improvement to the bezier code. --- graphics/x11drv/graphics.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/graphics/x11drv/graphics.c b/graphics/x11drv/graphics.c index e60fed834f7..b4b70d5367b 100644 --- a/graphics/x11drv/graphics.c +++ b/graphics/x11drv/graphics.c @@ -976,10 +976,20 @@ static BOOL32 BezierCheck( int level, POINT32 *Points) INT32 dx, dy; dx=Points[3].x-Points[0].x; dy=Points[3].y-Points[0].y; - if(ABS(dy) Points[3].x) + return FALSE; + if(Points[2].x < Points[0].x){ + if(Points[2].x < Points[3].x) + return FALSE; + }else + if(Points[2].x > Points[3].x) + return FALSE; dx=BEZIERSHIFTDOWN(dx); if(!dx) return TRUE; if(abs(Points[1].y-Points[0].y-(dy/dx)* @@ -991,8 +1001,18 @@ static BOOL32 BezierCheck( int level, POINT32 *Points) return TRUE; }else{ /* steep line */ /* check that control points are between begin and end */ - if( (Points[1].y-Points[0].y)*dy < 0 || - (Points[2].y-Points[0].y)*dy < 0 ) return FALSE; + if(Points[1].y < Points[0].y){ + if(Points[1].y < Points[3].y) + return FALSE; + }else + if(Points[1].y > Points[3].y) + return FALSE; + if(Points[2].y < Points[0].y){ + if(Points[2].y < Points[3].y) + return FALSE; + }else + if(Points[2].y > Points[3].y) + return FALSE; dy=BEZIERSHIFTDOWN(dy); if(!dy) return TRUE; if(abs(Points[1].x-Points[0].x-(dx/dy)*