mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Fix gradient interpolation
When the percentage is missing, we should interpolate between the last valid entry to the first valid entry after that, not always the last valid entry in the whole gradient
This commit is contained in:
parent
9ae6d71619
commit
9fc838206a
1 changed files with 1 additions and 1 deletions
|
@ -478,7 +478,7 @@ impl Expression {
|
|||
if pos > 0 {
|
||||
let (middle, after) = rest.split_at_mut(pos);
|
||||
let begin = &before.last().expect("The first should never be invalid").1;
|
||||
let end = &after.last().expect("The last should never be invalid").1;
|
||||
let end = &after.first().expect("The last should never be invalid").1;
|
||||
for (i, (_, e)) in middle.iter_mut().enumerate() {
|
||||
debug_assert!(matches!(e, Expression::Invalid));
|
||||
// e = begin + (i+1) * (end - begin) / (pos+1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue