From 56cacb933697bb2d598dc10f1d5f9faa69a64f72 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 24 May 2000 22:47:54 +0000 Subject: [PATCH] Fixed the mdgradient code. P.S. Please, that piece of code is perfectly valid, there's no need to break it every month. There is nothing wrong with it, still it was changed (and simultaneously broken) 4 or 5 times already. That code use a smart trick to draw the multi diagonal gradient using integer operations, that is perfectly valid and moreover is much faster than the classical floating point calculation algorithm that was used before, so there is no need to randomly 'fix' it every now and then. If you don't understand how it works please ask. --- wrlib/gradient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrlib/gradient.c b/wrlib/gradient.c index 2232f2f4..4540384e 100644 --- a/wrlib/gradient.c +++ b/wrlib/gradient.c @@ -478,8 +478,8 @@ renderMDGradient(unsigned width, unsigned height, RColor **colors, int count) width = width * 3; /* copy the first line to the other lines with corresponding offset */ - for (offset=0; jdata[0]), &ptr[3*(int)offset], width); + for (j=0, offset=0; jdata[j]), &ptr[3*(int)offset], width); offset += a; } RDestroyImage(tmp); -- 2.11.4.GIT