You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
weak var view: MView?
fileprivate let onNodeChange: () -> Void
fileprivate let disposables = GroupDisposable()
fileprivate var active = false
weak var animationCache: AnimationCache?
init(node: Node, view: MView?, animationCache: AnimationCache?) {
self.view = view
self.animationCache = animationCache
onNodeChange = { [unowned node, weak view] in
guard let isAnimating = animationCache?.isAnimating(node) else {
return
}
if isAnimating {
return
}
DispatchQueue.main.async {
print("setNeedsDisplay=6")
view?.setNeedsDisplay()
}
}
addObservers()
}
view?.setNeedsDisplay() needs to be wrapped with DispatchQueue.main.async {}.
If not, we have crash for iOS 13.
But after we wrap it, it is very slow when changing color of shape.
I found the reason.
When changing color of shape, this framework is doing rerendering for whole group using group rendering.
Now it needs to be called for main thread as you can see above.
But the speed is very slow because of calling main thread much time.
How can we fix this issue?
Please let me know if you have any thought.
The text was updated successfully, but these errors were encountered:
class NodeRenderer {
view?.setNeedsDisplay() needs to be wrapped with DispatchQueue.main.async {}.
If not, we have crash for iOS 13.
But after we wrap it, it is very slow when changing color of shape.
I found the reason.
When changing color of shape, this framework is doing rerendering for whole group using group rendering.
Now it needs to be called for main thread as you can see above.
But the speed is very slow because of calling main thread much time.
How can we fix this issue?
Please let me know if you have any thought.
The text was updated successfully, but these errors were encountered: