Fix rounding when rounding to whole pixels.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@14315 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2002-08-22 00:34:50 +00:00
parent e61e02233f
commit ec1da56cfb
2 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2002-08-22 02:34 Alexander Malmberg <alexander@malmberg.org>
* Source/art/ARTContext.m: (-DPSrectclip::::): Fix rounding when
converting to pixel coordinates.
2002-08-21 20:27 Alexander Malmberg <alexander@malmberg.org>
* Source/art/ARTContext.m, Source/art/ARTWindowBuffer.h,

View file

@ -1542,6 +1542,13 @@ very expensive
p.y=wi->sy-p.y;
p.y-=s.height;
/* PS says that any pixel covered by the clipping path is not to
be clipped, so we need to round 'outwards' here. */
s.width=ceil(s.width+p.x);
s.height=ceil(s.height+p.y);
p.x=floor(p.x);
p.y=floor(p.y);
/* printf("%p clip was (%i %i)-(%i %i) (%g %g)+(%g %g) -> (%g %g)+(%g %g)\n",
self,
clip_x0,clip_y0,clip_x1,clip_y1,
@ -1552,8 +1559,9 @@ very expensive
if (p.y>clip_y0)
clip_y0=p.y;
p.x+=s.width;
p.y+=s.height;
p.x=s.width;
p.y=s.height;
if (p.x<clip_x1)
clip_x1=p.x;
if (p.y<clip_y1)