-
-
Notifications
You must be signed in to change notification settings - Fork 35
feat: Add discolorate
animation and refactored patch
function
#63
Conversation
refactor: Refactored apiChangeProperty a little
❌ Deploy Preview for newcar-copy failed.
|
❌ Deploy Preview for newcar-playground failed. Why did it fail? →
|
❌ Deploy Preview for newcar-docs failed. Why did it fail? →
|
❌ Deploy Preview for newcar-apis failed. Why did it fail? →
|
const changedProps = [ | ||
'style.fillColor.red', | ||
'style.fillColor.green', | ||
'style.fillColor.blue', | ||
'style.fillColor.alpha', | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也许可以考虑让用户传入希望改变的颜色?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
呃,什么意思啊?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要使用颜色动画的不只是 fillColor,还可能有 borderColor 以及组件自定义的其他颜色选项
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦,就是跟颜色相关的东西吧
我想可以给他们重新写几个文件,而不应该在这个函数上再做抽象来增加用户的理解难度
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以及方便调用 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重复写动画实际上有点不合理,因为自定义组件特有的颜色选项是开放的 API(这意味着它可能会是各种莫名其妙的名字),内置的动画泛用性还是应该更强一点(我觉得)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, 我会考虑你的建议,现在我把它修改了,若在实际使用中出现问题再论。
Cheers! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你把原来的demo全部复制粘贴上去,然后你就会发现几个问题:
- 帧率大大降低
- 原来的组件位置都有偏差
我想这两个漏洞都与你修改了patch有关
WARNING!
Must be tested carefully!