Merge pull request #820 from kawa-yoiko/fix-replace-colour

Fix colour replacement misses borders
This commit is contained in:
Vadim Grigoruk 2019-03-21 10:55:36 +03:00 committed by GitHub
commit 8114f1b13d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}