Flipboard / Flipboard/react-canvas

About layout calculation in 'draw' function

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
13.2k
Forks
909
PR merge metrics
No merged PRs in 30d

Description

I see every time surface draw,it will calculate the layout again:

draw: function () {
var layout;
if (this.node) {
if (this.props.enableCSSLayout) {
layout = layoutNode(this.node);
}
DrawingUtils.drawRenderLayer(this.getContext(), this.node);
}
},

But I think only calculate the whole layout when style changed with the layout is better,for example,change the backgroundColor do not recalculate the laytout.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.