Re: [AD] Patch for rotate.c |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Elias Pschernig wrote:
Sorry if I was unclear. What I meant was, the patch does what it was intended to do, namely forgives the user for doing wrong (i.e., it avoids ugly pixels when the user tries to draw outside the bitmap with clipping turned off). I then questioned whether we should be that "nice" to users. I think it would be good to also add an ASSERT that fails when users try to draw outside the BITMAP with clipping turned off, so that they can fix their programs. I attach a patch that does this. OK?But isn't the clip->right also used when clipping is turned on? So I don't see how it can just be changed (and too lazy to read the source).
I'm not sure I understand your question, but I'll try to answer it anyway :-).
Sure, we clip against the right edge when clipping is on. In fact, we clip against the right edge even when clipping is off, too (because it is as fast to clip as it is to check if clipping is on). At the moment, however, clipping against the right edge is one pixel wrong, so that ugly pixels appear on the left (which is actually fine, because Allegro's API does not promise to behave in this case). David's patch fixed this, anyway, which is good because it makes the code more consistent and readable. My patch does the same, and in addition puts ASSERTs that ensure we are not drawing outside the BITMAP with clipping off.
/Sven
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |