mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-29 13:03:36 +01:00
display: fix bound checking in drect_border (#14)
Bounds would be moved before drawing the border, therefore displacing the border. Since drect() already performs all the necessary checks, this change doesn't try to save a couple of function calls and drops the redundant checks.
This commit is contained in:
parent
392d033e4a
commit
c4ec06d6ab
1 changed files with 1 additions and 6 deletions
|
@ -8,12 +8,7 @@ void drect_border(int x1, int y1, int x2, int y2, int fill, int width,
|
|||
if(x1 > x2) swap(x1, x2);
|
||||
if(y1 > y2) swap(y1, y2);
|
||||
|
||||
/* Order and bounds */
|
||||
if(x1 >= 396 || x2 < 0 || y1 >= 224 || y2 < 0) return;
|
||||
if(x1 < 0) x1 = 0;
|
||||
if(x2 >= 396) x2 = 395;
|
||||
if(y1 < 0) y1 = 0;
|
||||
if(y2 >= 224) y2 = 223;
|
||||
if(x1 >= DWIDTH || x2 < 0 || y1 >= DHEIGHT || y2 < 0) return;
|
||||
|
||||
drect(x1, y1, x2, y1 + (width-1), border);
|
||||
drect(x1, y2 - (width-1), x2, y2, border);
|
||||
|
|
Loading…
Reference in a new issue