Author: leonardo
Date: 2008-03-28 09:30:25 -0700 (Fri, 28 Mar 2008)
New Revision: 8613

Modified:
   trunk/gs/src/gsdps1.c
Log:
Fix (graphics) : rectfill applied a wrong path adjustment.

DETAILS :

Bug 689361 "Text has white stripes and missing parts at 100 dpi".

Ghostsctript applies path adjustment as an implementation of
"any part of pixel inside" filling rule. 
However it was wrong for rectfill :
the lower adjustment was too wide, causing extra pixels to paint
when the lower coordinate of the rectangle falls to pixel center.
Besides that, the X adjustment was applied to Y axis.

EXPECTED DIFFERENCES :

This change causes multiple minor raster difference :

raster 72 dpi :

"H:\AuxFiles\CompareFiles\Bug688308.ps" 

300 dpi :

"H:\AuxFiles\CompareFiles\213-01.ps" 
"H:\AuxFiles\CompareFiles\244-01.ps" 
"H:\AuxFiles\CompareFiles\245-01.ps" 
"H:\AuxFiles\CompareFiles\245-07.ps" 
"H:\AuxFiles\CompareFiles\245-13.ps" 
"H:\AuxFiles\CompareFiles\269-01.ps" 
"H:\AuxFiles\CompareFiles\401-01.ps" 
"H:\AuxFiles\CompareFiles\421-01.ps" 
"H:\AuxFiles\CompareFiles\456-01.ps" 
"H:\AuxFiles\CompareFiles\Bug688308.ps" 
"H:\AuxFiles\CompareFiles\Bug688584.ps" 

It may cause raster differences with ghostpcl,
which are not checked here.


Modified: trunk/gs/src/gsdps1.c
===================================================================
--- trunk/gs/src/gsdps1.c	2008-03-28 06:36:49 UTC (rev 8612)
+++ trunk/gs/src/gsdps1.c	2008-03-28 16:30:25 UTC (rev 8613)
@@ -244,10 +244,10 @@
 	    } else {
 		int x, y, w, h;
 
-		draw_rect.p.x -= pgs->fill_adjust.x;
-		draw_rect.p.y -= pgs->fill_adjust.x;
+		draw_rect.p.x -= max(pgs->fill_adjust.x - fixed_epsilon, 0);
+		draw_rect.p.y -= max(pgs->fill_adjust.y - fixed_epsilon, 0);
 		draw_rect.q.x += pgs->fill_adjust.x;
-		draw_rect.q.y += pgs->fill_adjust.x;
+		draw_rect.q.y += pgs->fill_adjust.y;
 		rect_intersect(draw_rect, clip_rect);
 		x = fixed2int_pixround(draw_rect.p.x);
 		y = fixed2int_pixround(draw_rect.p.y);

_______________________________________________
gs-cvs mailing list
gs-cvs@ghostscript.com
http://www.ghostscript.com/mailman/listinfo/gs-cvs
