diff options
author | Florrie <towerofnix@gmail.com> | 2019-09-18 16:05:11 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-09-18 16:05:11 -0300 |
commit | e4ae17895cd673bdc8a8a2a060b835b0492daeb1 (patch) | |
tree | a9dfe0d85928c0e12a80d214d162507126244bf9 /ui | |
parent | 49eb24099f0a6088976972df5ecb7c927c78a110 (diff) |
Make label text a draw dependency
This makes the screen be automatically redrawn whenever a label's text is updated.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/Label.js | 5 |
1 files changed, 3 insertions, 2 deletions
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') } } |