Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redraw method #2878

Merged
merged 2 commits into from
Apr 2, 2019
Merged

Add redraw method #2878

merged 2 commits into from
Apr 2, 2019

Conversation

Pessimistress
Copy link
Collaborator

For google maps integration

@coveralls
Copy link

coveralls commented Apr 2, 2019

Coverage Status

Coverage decreased (-0.01%) to 61.423% when pulling 91a6c98 on x/redraw into 071c44f on master.

docs/api-reference/deck.md Outdated Show resolved Hide resolved
const redrawReason = this.needsRedraw({clearRedrawFlags: true});

if (!redrawReason) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe provide the option to skip the check (e.g. a force argument that defaults to false)? I can imagine scenarios where that would be useful.

@Pessimistress Pessimistress merged commit 1a9de87 into master Apr 2, 2019
@Pessimistress Pessimistress deleted the x/redraw branch April 2, 2019 17:42

Attempt to draw immediately, rather than waiting for the next draw cycle. By default, deck flushes all changes to the canvas on each animation frame. This behavior might cause the deck canvas to fall out of sync with other components if synchronous updates are required.

Redrawing frequently outside of rAF may cause performance problems. Only use this method if the render cycle must be managed manually.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rAF sounds like something that people may not understand on first read maybe type it out or add some link or extra paragraph?

this._drawLayers(redrawReason);
}
// Redraw if necessary
this.redraw(false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit: My concerns about boolean parameters are already well know so I was planning to keep my peace, but I couldn't help but notice that we already felt the need to add a comment explaining what the false parameter means, and this is not even in application code, but in the very same file as the function definition....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants