Coder Social home page Coder Social logo

macaw-examples's People

Contributors

f3dm76 avatar shipinev avatar vhailor13 avatar ystrot avatar zapletnev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

macaw-examples's Issues

Can not get compile through

Overridden method 'equals' has generic signature which is incompatible with base method's generic signature ; expected generic signature to be

Screen Shot 2020-04-20 at 3 23 35 PM

PeriodicTable issue

스크린샷 2021-08-06 오후 8 27 34

스크린샷 2021-08-06 오후 8 27 48

스크린샷 2021-08-06 오후 8 28 36

I created a mobile app that is very similar to PeriodicTable.
but my app not run
Which NSCoder type goes into parameters when invoking PeriodicTable?
Sorry, my app doesn't use storyboard. And if you're using a storyboard, nothing will appear on the screen. Help me, please.

Speed issue

I'm trying to change color of shape using following code:
@discardableResult public func replaceColors(node: Node, color: Fill?) -> Bool {
if let shape = node as? Shape {
shape.fill = color
return true
}
return false
}

At that moment, following code will be called:

group.contentsVar.onChange { [weak self] _ in
self?.updateRenderers()
}

private func updateRenderers() {
renderers.forEach { $0.dispose() }
renderers.removeAll()

    if let updatedRenderers = group?.contents.compactMap ({ child -> NodeRenderer? in
        guard let interval = renderingInterval else {
            print("setNeedsDisplay=6-2")
            return RenderUtils.createNodeRenderer(child, view: view, animationCache: animationCache)
        }

        let index = AnimationUtils.absoluteIndex(child, useCache: true)
        if index > interval.from && index < interval.to {
            print("setNeedsDisplay=6-3")
            return RenderUtils.createNodeRenderer(child, view: view, animationCache: animationCache, interval: interval)
        }

        return .none

    }) {
        renderers = updatedRenderers
    }
}

Btw when the color of shape is changed, updateRenderers() will be called much time.
It lowered the speed of the app.
How can we call updateRenderers() only once for changed shape?

Crash for iOS 13

class NodeRenderer {

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.