File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments