mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
wg_engine: fix fill spread artifacts
[issues 2435: ](FillSpread) example Fixed range selector edged cases
This commit is contained in:
parent
3cb7aecb6a
commit
8d150a17b4
1 changed files with 2 additions and 2 deletions
|
@ -200,7 +200,7 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4f {
|
|||
for (var i = 0i; i < last; i++) {
|
||||
let strt = uLinearGradient.stopPoints[i/4][i%4];
|
||||
let stop = uLinearGradient.stopPoints[(i+1)/4][(i+1)%4];
|
||||
if ((t > strt) && (t < stop)) {
|
||||
if ((t >= strt) && (t < stop)) {
|
||||
let step: f32 = (t - strt) / (stop - strt);
|
||||
color = mix(uLinearGradient.stopColors[i], uLinearGradient.stopColors[i+1], step);
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4f {
|
|||
for (var i = 0i; i < last; i++) {
|
||||
let strt = uRadialGradient.stopPoints[i/4][i%4];
|
||||
let stop = uRadialGradient.stopPoints[(i+1)/4][(i+1)%4];
|
||||
if ((t > strt) && (t < stop)) {
|
||||
if ((t >= strt) && (t < stop)) {
|
||||
let step: f32 = (t - strt) / (stop - strt);
|
||||
color = mix(uRadialGradient.stopColors[i], uRadialGradient.stopColors[i+1], step);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue