|
176 | 176 |
|
177 | 177 | ---@private |
178 | 178 | function BasaltProgram:resize(width, height) |
| 179 | + if type(width)~="number" or type(height)~="number" then return end |
179 | 180 | self.window.reposition(1, 1, width, height) |
180 | 181 | self:resume("term_resize", width, height) |
181 | 182 | end |
@@ -255,16 +256,16 @@ end |
255 | 256 | function Program:init(props, basalt) |
256 | 257 | VisualElement.init(self, props, basalt) |
257 | 258 | self.set("type", "Program") |
258 | | - self:observe("width", function(self, width) |
| 259 | + self:observe("width", function(_, width) |
259 | 260 | local program = self.getResolved("program") |
260 | 261 | if program then |
261 | | - program:resize(width, self.getResolved("height")) |
| 262 | + program:resize(self.get("width"), self.get("height")) |
262 | 263 | end |
263 | 264 | end) |
264 | | - self:observe("height", function(self, height) |
| 265 | + self:observe("height", function(_, height) |
265 | 266 | local program = self.getResolved("program") |
266 | 267 | if program then |
267 | | - program:resize(self.getResolved("width"), height) |
| 268 | + program:resize(self.get("width"), self.get("height")) |
268 | 269 | end |
269 | 270 | end) |
270 | 271 | return self |
|
0 commit comments