sw_engine fill: fixing gradient calculations for 'repeat' spread value

There was a call to the ctable element from outside its boundaries, because
the check was misplaced.
This commit is contained in:
Mira Grudzinska 2021-06-22 11:35:22 +02:00 committed by Hermet Park
parent 5bbe713ca5
commit a0f28d0db4

View file

@ -171,8 +171,8 @@ static inline uint32_t _clamp(const SwFill* fill, int32_t pos)
break;
}
case FillSpread::Repeat: {
if (pos < 0) pos = GRADIENT_STOP_SIZE + pos;
pos = pos % GRADIENT_STOP_SIZE;
if (pos < 0) pos = GRADIENT_STOP_SIZE + pos;
break;
}
case FillSpread::Reflect: {