From 468af075c3d6b29e6e233325993a8aca72c2a7b0 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 23 Oct 2008 06:59:11 +0000 Subject: [PATCH] Fixed the vector calculation. You can now draw gradiation rectangles. However there is still some work needed : -Some crash when the calculation gives something outside the range (clipping will probably do the trick) -Divide by zero or something nasty like that when doing a vertical vector -Some vector give horizontal gradiation... maybe because all the calculations are done with integers -The operation handler still need some work : rigt click for cancelling, displaying the selected rectangle properly. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@302 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- graph.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/graph.c b/graph.c index fb909df4..a363d992 100644 --- a/graph.c +++ b/graph.c @@ -5197,17 +5197,21 @@ void Tracer_rectangle_degrade(short RAX,short RAY,short RBX,short RBY,short VAX, Degrade_Intervalle_total = sqrt(pow(VBY - VAY,2)+pow(VBX - VAX,2)); short a = (VBY - VAY)/(VBX - VAX); - short b = a * VAX - VAY; + short b = VAY - a*VAX; short Distance_X, Distance_Y; + DEBUG("inttotal",Degrade_Intervalle_total); + for (Pos_Y=RAY;Pos_Y