From ca3620f4bcd801624ac2232e6e20d0eec5c424e9 Mon Sep 17 00:00:00 2001 From: kramm Date: Thu, 8 May 2008 15:10:34 +0000 Subject: [PATCH] fixed previous antializer fix --- lib/pdf/GFXOutputDev.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index ae26f2b..c88a035 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -1972,19 +1972,23 @@ unsigned char* antialize(unsigned char*data, int width, int height, int newwidth double ex = px + fx; int fromx = (int)px; int tox = (int)ex; - int xweight1 = (int)(((fromx+1)-px)*256); + int xweight1 = (int)((1-(px-fromx))*256); int xweight2 = (int)((ex-tox)*256); double py =0; for(y=0;y=width) + tox = width-1; + if(toy>=height) + toy = height-1; + for(xx=fromx;xx<=tox;xx++) + for(yy=fromy;yy<=toy;yy++) { int b = 1-data[width*yy+xx]; int weight=256; if(xx==fromx) weight = (weight*xweight1)/256; -- 1.7.10.4