mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
wg_engine: fix equals gradient offsets
In case if gradient offsets are equal the last color are used instead of first
This commit is contained in:
parent
144fecc3a1
commit
f13c72e3d7
1 changed files with 2 additions and 0 deletions
|
@ -146,6 +146,8 @@ void WgShaderTypeGradient::updateTexData(const Fill::ColorStop* stops, uint32_t
|
|||
for (uint32_t i = 1; i < stopCnt; i++)
|
||||
if (sstops.last().offset < stops[i].offset)
|
||||
sstops.push(stops[i]);
|
||||
else if (sstops.last().offset == stops[i].offset)
|
||||
sstops.last() = stops[i];
|
||||
// head
|
||||
uint32_t range_s = 0;
|
||||
uint32_t range_e = uint32_t(sstops[0].offset * (WG_TEXTURE_GRADIENT_SIZE-1));
|
||||
|
|
Loading…
Add table
Reference in a new issue