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
978464d87c
commit
cb0691fee0
1 changed files with 5 additions and 5 deletions
|
@ -460,7 +460,9 @@ static bool _setCell(RleWorker& rw, SwPoint pos)
|
||||||
pos.x -= rw.cellMin.x;
|
pos.x -= rw.cellMin.x;
|
||||||
pos.y -= rw.cellMin.y;
|
pos.y -= rw.cellMin.y;
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -468,11 +470,9 @@ static bool _setCell(RleWorker& rw, SwPoint pos)
|
||||||
if (!rw.invalid) {
|
if (!rw.invalid) {
|
||||||
if (!_recordCell(rw)) return false;
|
if (!_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