Skip to content

Commit 7d540f3

Browse files
committed
fix
1 parent a6b0089 commit 7d540f3

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

navigator.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,23 +152,16 @@ namespace user_interface_base {
152152
private height: number;
153153
private widths: number[];
154154

155-
constructor(height: number, width?: number, widths?: number[]) {
155+
constructor() {
156156
super()
157-
this.height = height
158-
159-
if (widths != null) {
160-
this.widths = widths
161-
}
162-
else {
163-
width = (width != null) ? width : 1
164-
this.widths = []
165-
for (let _ = 0; _ < height; _++)
166-
this.widths.push(width)
167-
}
157+
this.height = 0;
158+
this.widths = []
168159
}
169160

170161
public addButtons(btns: Button[]) {
171162
this.buttonGroups.push(btns)
163+
this.widths.push(btns.length)
164+
this.height++
172165
}
173166

174167
public move(dir: CursorDir) {
@@ -221,8 +214,6 @@ namespace user_interface_base {
221214
}
222215
}
223216

224-
// const index = this.widths.slice(0, this.row).reduce((p, c) => p + c, 0)
225-
226217
const btn = this.buttonGroups[this.row][this.col]
227218
this.reportAria(btn)
228219
return btn

0 commit comments

Comments
 (0)