From e4ae17895cd673bdc8a8a2a060b835b0492daeb1 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 18 Sep 2019 16:05:11 -0300 Subject: Make label text a draw dependency This makes the screen be automatically redrawn whenever a label's text is updated. --- ui/Label.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/Label.js b/ui/Label.js index e320574..d1b3098 100644 --- a/ui/Label.js +++ b/ui/Label.js @@ -36,11 +36,12 @@ module.exports = class Label extends DisplayElement { } set text(newText) { - this._text = newText + const ret = this.setDep('text', newText) this.fixLayout() + return ret } get text() { - return this._text + return this.getDep('text') } } -- cgit 1.3.0-6-gf8a5