Layout: Add `forgetLazyState` method
parent
3cfd94314e
commit
cdf95566bd
|
|
@ -74,7 +74,7 @@ function update() {
|
||||||
if (current) {
|
if (current) {
|
||||||
draw();
|
draw();
|
||||||
} else {
|
} else {
|
||||||
delete layout.rects;
|
layout.forgetLazyState();
|
||||||
if (NRF.getSecurityStatus().connected) {
|
if (NRF.getSecurityStatus().connected) {
|
||||||
E.showMessage("Weather unknown\n\nIs Gadgetbridge\nweather reporting\nset up on your\nphone?");
|
E.showMessage("Weather unknown\n\nIs Gadgetbridge\nweather reporting\nset up on your\nphone?");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ Other functions:
|
||||||
* `layout.update()` - update positions of everything if contents have changed
|
* `layout.update()` - update positions of everything if contents have changed
|
||||||
* `layout.debug(obj)` - draw outlines for objects on screen
|
* `layout.debug(obj)` - draw outlines for objects on screen
|
||||||
* `layout.clear(obj)` - clear the given object (you can also just specify `bgCol` to clear before each render)
|
* `layout.clear(obj)` - clear the given object (you can also just specify `bgCol` to clear before each render)
|
||||||
|
* `layout.forgetLazyState()` - if lazy rendering is enabled, makes the next call to `render()` perform a full re-render
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -258,6 +259,10 @@ Layout.prototype.render = function (l) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Layout.prototype.forgetLazyState = function () {
|
||||||
|
this.rects = {};
|
||||||
|
}
|
||||||
|
|
||||||
Layout.prototype.layout = function (l) {
|
Layout.prototype.layout = function (l) {
|
||||||
// l = current layout element
|
// l = current layout element
|
||||||
// exw,exh = extra width/height available
|
// exw,exh = extra width/height available
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue