Fix crash with smudge tool around the edges

This commit is contained in:
jacob1
2014-01-09 12:55:39 -05:00
parent aea8402383
commit d901b2f8ef

View File

@@ -782,6 +782,8 @@ void Simulation::ApplyDecoration(int x, int y, int colR_, int colG_, int colB_,
tb /= 1.0f+(colB*strength)*colA;
}
else if (mode == DECO_SMUDGE)
{
if (x >= CELL && x < XRES-CELL && y >= CELL && y < YRES-CELL)
{
float tas = 0.0f, trs = 0.0f, tgs = 0.0f, tbs = 0.0f;
@@ -809,6 +811,7 @@ void Simulation::ApplyDecoration(int x, int y, int colR_, int colG_, int colB_,
if (!parts[rp>>8].dcolour)
ta -= 3/255.0f;
}
}
ta *= 255.0f; tr *= 255.0f; tg *= 255.0f; tb *= 255.0f;
ta += .5f; tr += .5f; tg += .5f; tb += .5f;