Layout: defer initial update until first render
parent
202690de40
commit
f37b744ed5
|
|
@ -140,7 +140,7 @@ function Layout(layout, buttons, options) {
|
||||||
if (l.c) l.c.forEach(idRecurser);
|
if (l.c) l.c.forEach(idRecurser);
|
||||||
}
|
}
|
||||||
idRecurser(layout);
|
idRecurser(layout);
|
||||||
this.update();
|
this.updateNeeded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.prototype.remove = function (l) {
|
Layout.prototype.remove = function (l) {
|
||||||
|
|
@ -196,6 +196,7 @@ function prepareLazyRender(l, rectsToClear, drawList, rects, parentBg) {
|
||||||
|
|
||||||
Layout.prototype.render = function (l) {
|
Layout.prototype.render = function (l) {
|
||||||
if (!l) l = this._l;
|
if (!l) l = this._l;
|
||||||
|
if (this.updateNeeded) this.update();
|
||||||
|
|
||||||
function render(l) {"ram"
|
function render(l) {"ram"
|
||||||
g.reset();
|
g.reset();
|
||||||
|
|
@ -309,6 +310,7 @@ Layout.prototype.debug = function(l,c) {
|
||||||
if (l.c) l.c.forEach(n => this.debug(n,c));
|
if (l.c) l.c.forEach(n => this.debug(n,c));
|
||||||
};
|
};
|
||||||
Layout.prototype.update = function() {
|
Layout.prototype.update = function() {
|
||||||
|
delete this.updateNeeded;
|
||||||
var l = this._l;
|
var l = this._l;
|
||||||
var w = g.getWidth();
|
var w = g.getWidth();
|
||||||
var y = this.yOffset;
|
var y = this.yOffset;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue