mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 12:34:30 +00:00
wg_engine: fix fill spread artifacts
[issues 2435: ](FillSpread) example Fixed range selector edged cases
This commit is contained in:
parent
71ba9ab7cf
commit
4cc132ad47
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++) {
|
for (var i = 0i; i < last; i++) {
|
||||||
let strt = uLinearGradient.stopPoints[i/4][i%4];
|
let strt = uLinearGradient.stopPoints[i/4][i%4];
|
||||||
let stop = uLinearGradient.stopPoints[(i+1)/4][(i+1)%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);
|
let step: f32 = (t - strt) / (stop - strt);
|
||||||
color = mix(uLinearGradient.stopColors[i], uLinearGradient.stopColors[i+1], step);
|
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++) {
|
for (var i = 0i; i < last; i++) {
|
||||||
let strt = uRadialGradient.stopPoints[i/4][i%4];
|
let strt = uRadialGradient.stopPoints[i/4][i%4];
|
||||||
let stop = uRadialGradient.stopPoints[(i+1)/4][(i+1)%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);
|
let step: f32 = (t - strt) / (stop - strt);
|
||||||
color = mix(uRadialGradient.stopColors[i], uRadialGradient.stopColors[i+1], step);
|
color = mix(uRadialGradient.stopColors[i], uRadialGradient.stopColors[i+1], step);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue