mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
sw_engine: corrected the rle cell building
Properly build the cell cover value when a new cell value is just overlapped. This fixes certain weird visual artifacts at a corner case. issue: https://github.com/thorvg/thorvg/issues/2929
This commit is contained in:
parent
47524300bb
commit
2fb925a2d7
1 changed files with 5 additions and 5 deletions
|
@ -451,17 +451,17 @@ static bool _setCell(RleWorker& rw, SwPoint pos)
|
||||||
min_ex - 1 horizontal position. */
|
min_ex - 1 horizontal position. */
|
||||||
pos -= rw.cellMin;
|
pos -= rw.cellMin;
|
||||||
|
|
||||||
if (pos.x > rw.cellMax.x) pos.x = rw.cellMax.x;
|
//exceptions
|
||||||
|
if (pos.x < 0) pos.x = -1;
|
||||||
|
else if (pos.x > rw.cellMax.x) pos.x = rw.cellMax.x;
|
||||||
|
|
||||||
//Are we moving to a different cell?
|
//Are we moving to a different cell?
|
||||||
if (pos != rw.cellPos) {
|
if (pos != rw.cellPos) {
|
||||||
//Record the current one if it is valid
|
//Record the current one if it is valid
|
||||||
if (!rw.invalid && !_recordCell(rw)) return false;
|
if (!rw.invalid && !_recordCell(rw)) return false;
|
||||||
|
rw.area = rw.cover = 0;
|
||||||
|
rw.cellPos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
rw.area = 0;
|
|
||||||
rw.cover = 0;
|
|
||||||
rw.cellPos = pos;
|
|
||||||
rw.invalid = ((unsigned)pos.y >= (unsigned)rw.cellYCnt || pos.x >= rw.cellXCnt);
|
rw.invalid = ((unsigned)pos.y >= (unsigned)rw.cellYCnt || pos.x >= rw.cellXCnt);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue