Fix #586 replace colour misses borders

This commit is contained in:
Shiqing 2019-03-17 13:24:08 +08:00
parent b09049ee45
commit 7d5e5e42f5
1 changed files with 3 additions and 3 deletions

View File

@ -266,8 +266,8 @@ static void floodFill(Sprite* sprite, s32 l, s32 t, s32 r, s32 b, s32 x, s32 y,
static void replaceColor(Sprite* sprite, s32 l, s32 t, s32 r, s32 b, s32 x, s32 y, u8 color, u8 fill)
{
for(s32 sy = t; sy < b; sy++)
for(s32 sx = l; sx < r; sx++)
for(s32 sy = t; sy <= b; sy++)
for(s32 sx = l; sx <= r; sx++)
if(getSheetPixel(sprite, sx, sy) == color)
setSheetPixel(sprite, sx, sy, fill);
}
@ -1753,4 +1753,4 @@ void initSprite(Sprite* sprite, tic_mem* tic, tic_tiles* src)
.overline = overline,
.scanline = scanline,
};
}
}