mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-16 04:54:39 +00:00
gl_engine: fix gradient color interpretation error
Fix when gradient position is same as some starting or ending point of a gradient stop, the output color is blank
This commit is contained in:
parent
eadf66e178
commit
059c452249
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@ vec4 gradient(float t)
|
||||||
{ \n
|
{ \n
|
||||||
float stopi = gradientStop(i); \n
|
float stopi = gradientStop(i); \n
|
||||||
float stopi1 = gradientStop(i + 1); \n
|
float stopi1 = gradientStop(i + 1); \n
|
||||||
if (t > stopi && t <stopi1) \n
|
if (t >= stopi && t <= stopi1) \n
|
||||||
{ \n
|
{ \n
|
||||||
col = (uGradientInfo.stopColors[i] * (1. - gradientStep(stopi, stopi1, t))); \n
|
col = (uGradientInfo.stopColors[i] * (1. - gradientStep(stopi, stopi1, t))); \n
|
||||||
col += (uGradientInfo.stopColors[i + 1] * gradientStep(stopi, stopi1, t)); \n
|
col += (uGradientInfo.stopColors[i + 1] * gradientStep(stopi, stopi1, t)); \n
|
||||||
|
|
Loading…
Add table
Reference in a new issue