Skip to content

Commit

Permalink
实现画面外的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Apr 15, 2016
1 parent 6231343 commit de008d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions 11_day/sheet.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ void sheet_refreshsub(struct SHTCTL *ctl, int vx0, int vy0, int vx1, int vy1)
int h, bx, by, vx, vy, bx0, by0, bx1, by1;
unsigned char *buf, c, *vram = ctl->vram;
struct SHEET *sht;

/* 如果refresh的范围超出了画面则修正 */
if (vx0 < 0) { vx0 = 0; }
if (vy0 < 0) { vy0 = 0; }
if (vx1 > ctl->xsize) { vx1 = ctl->xsize; }
if (vy1 > ctl->ysize) { vy1 = ctl->ysize; }

for (h = 0; h <= ctl->top; h++) {
sht = ctl->sheets[h];
buf = sht->buf;
Expand Down

0 comments on commit de008d0

Please sign in to comment.