Conversation
added 2 commits
November 6, 2021 20:13
Author
Contributor
|
@kakachake thank you, I have merged to |
|
这个功能有个问题,如果filter和map指定刚好重复的话会返回异常的值 <div
class="lift-transition-sticky-content"
tg-from="0"
tg-to="100"
tg-edge="cover"
tg-name="position"
tg-filter="0,50,100@"
tg-map="0:50;50:0;100:0"
></div>在 export function parseValues() {
if (filter.values.length > 0 && !filter.values.includes(value)) {
if (filter.mode === 'smooth') {
let region = calcKeyFrameRegion(mapping, value);
if (region.length) {
// 这里获取的范围值是 0
value = calcKeyFrameValue(mapping, value, region);
} else {
return;
}
} else {
if (filter.mode === 'exact') {
element.lastValue = null;
el.style.removeProperty(name);
}
return;
}
}
// 这里会根据value的值重新获取映射导致异常
if (typeof mapping[value] !== 'undefined') {
value = mapping[value];
}
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

使用该参数可在map指定的参数间平滑过渡,结合css的transition可达到更好的效果,当前仅支持map的value为数字时使用,效果如下:
