mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
1998-03-12 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gmc-chargrid.c (update_region): Added clipping of region bounds.
This commit is contained in:
parent
6e4e6e029e
commit
1ee3e159aa
@ -2,6 +2,7 @@
|
||||
|
||||
* gmc-chargrid.c (gmc_char_grid_draw): Someone teach me how to
|
||||
subtract. Fixed a stupid offsetting bug.
|
||||
(update_region): Added clipping of region bounds.
|
||||
|
||||
* gmc-chargrid.c: Changed the struct attr with pointers mess with
|
||||
something saner.
|
||||
|
@ -327,10 +327,10 @@ update_region (GmcCharGrid *cgrid, int x, int y, int width, int height)
|
||||
if ((width == 0) || (height == 0))
|
||||
return;
|
||||
|
||||
/* sanity checks */
|
||||
|
||||
g_assert ((x + width) <= cgrid->width);
|
||||
g_assert ((y + height) <= cgrid->height);
|
||||
x = MAX (0, x);
|
||||
y = MAX (0, y);
|
||||
width = MIN (width, cgrid->width - x);
|
||||
height = MIN (height, cgrid->height - y);
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
update_strip (cgrid, x, y + i, width);
|
||||
|
Loading…
Reference in New Issue
Block a user