Coder Social home page Coder Social logo

Comments (5)

barmalei avatar barmalei commented on July 19, 2024

The idea of doing repainting asynchronous is improving zebra painting performance. During event handling, component hierarchy validation multiple repaint method calls can occur. But all of them just update dirty area and trigger (if it has not been already triggered) repainting thread (well, thread is not a very good term in the case of JS).

Regarding repainting customization. You can try to replace "window.requestAFrame" with an own implementation. The method is called by zebra paint manager to trigger re-paint thread. The method gets function that actually has to be called to do the real painting. Sort of:

window.requestAFrame = function(f) {
     f();
};

For more deep repainting customization you can write an own paint manager and configure it via "zebra.json".

from zebkit.

joeedh avatar joeedh commented on July 19, 2024

I actually added an immediateRepaint to PaintManImpl (rather hackishly; I just shove it into PaintManImpl.prototype and zebra.ui.paintManager).

I do think this should be configurable, or at least more flexible.

from zebkit.

joeedh avatar joeedh commented on July 19, 2024

Also, any way clearRect could be called when updating or removing window components that don't have a zebra element behind them? I have my own hackish solution, but something better would be nice.

from zebkit.

barmalei avatar barmalei commented on July 19, 2024

I am not aware too much about what you are doing with painting, but have doubt that immediatePaint will does repainting more effective than postponed repaint. Also don't understand what you mean with "should be configurable or at least more flexible", "Also, any way clearRect could be called when updating ..."
?

from zebkit.

joeedh avatar joeedh commented on July 19, 2024

Basically, the delayed paint causes flickering. This could be related to my second point, that the canvas behind windows isn't cleared when moving them (not if there isn't another visible zebra component behind them, at least).

from zebkit.

Related Issues (20)

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.