Merge pull request #820 from kawa-yoiko/fix-replace-colour
Fix colour replacement misses borders
This commit is contained in:
commit
8114f1b13d
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue