mirror of https://github.com/espruino/BangleApps
Layout: Add `forgetLazyState` method
parent
3cfd94314e
commit
cdf95566bd
|
@ -74,7 +74,7 @@ function update() {
|
|||
if (current) {
|
||||
draw();
|
||||
} else {
|
||||
delete layout.rects;
|
||||
layout.forgetLazyState();
|
||||
if (NRF.getSecurityStatus().connected) {
|
||||
E.showMessage("Weather unknown\n\nIs Gadgetbridge\nweather reporting\nset up on your\nphone?");
|
||||
} else {
|
||||
|
|
|
@ -73,6 +73,7 @@ Other functions:
|
|||
* `layout.update()` - update positions of everything if contents have changed
|
||||
* `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.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) {
|
||||
// l = current layout element
|
||||
// exw,exh = extra width/height available
|
||||
|
|
Loading…
Reference in New Issue