Re: [AD] some small patches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Hm, I see.. in this case, this is simply a bug. This voids my docs
> patch. Setting the clipping rectangle already works, just not to the
> right and to the bottom - the following patch aims at fixing it:

diff -u -r1.44 graphics.c
--- src/graphics.c	9 Oct 2002 06:14:57 -0000	1.44
+++ src/graphics.c	1 Nov 2002 11:46:36 -0000
@@ -1405,8 +1405,8 @@
    y2++;
 
    bitmap->clip = TRUE;
-   bitmap->cl = MID(0, x1, bitmap->w-1);
-   bitmap->ct = MID(0, y1, bitmap->h-1);
+   bitmap->cl = MID(0, x1, bitmap->w);
+   bitmap->ct = MID(0, y1, bitmap->h);
    bitmap->cr = MID(0, x2, bitmap->w);
    bitmap->cb = MID(0, y2, bitmap->h);


Nope, there is no bug here: cl and ct are inclusive delimiters, whereas cr and 
cb are exclusive ones. And it should probably be:

    bitmap->cr = MID(1, x2, bitmap->w);
    bitmap->cb = MID(1, y2, bitmap->h);

-- 
Eric Botcazou



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/