Showing 1 changed files with 5 additions and 12 deletions
+5 -12
Nasal/MFD.pages.nas
... ...
@@ -34,7 +34,7 @@ displayClass.MFD = {
34 34
             var obj_s = size(obj_infos);
35 35
             me.device.windows.draw(
36 36
                 windowId,
37
-                {x: 720, y: 758 - ((lines + 3) * 24), w: 300, l: lines, sep: 1},
37
+                {autogeom: 1},
38 38
                 obj_infos
39 39
             );
40 40
             me.device.buttons.CLR = func {
... ...
@@ -79,11 +79,9 @@ displayClass.MFD = {
79 79
             }
80 80
             append(obj_infos, {type: 'separator'});
81 81
             var windowId = 'NEAREST AIRPORTS';
82
-            var obj_s = size(obj_infos);
83
-            var lines = 9;
84 82
             me.device.windows.draw(
85 83
                 windowId,
86
-                {x: 1014 - (name_max_length * 10), y: 778 - ((lines + 3) * 24), w: name_max_length * 10, l: lines, sep: 1},
84
+                {autogeom: 1},
87 85
                 obj_infos,
88 86
                 {lines: 4, columns: 1}
89 87
             );
... ...
@@ -121,12 +119,9 @@ displayClass.MFD = {
121 119
             {type: 'separator'},
122 120
         ];
123 121
         var idx = 0;
124
-        var name_max_length = 20;
125 122
         foreach (var navaid; navaids) {
126 123
             var (course, distance) = courseAndDistance(navaid);
127 124
             var name = navaid.id ~ ' (' ~ navaid.name ~ ')';
128
-            if (size(name) > name_max_length)
129
-                name_max_length = size(name);
130 125
 
131 126
             append(obj_infos, {
132 127
                     text: navaid.id ~ ' (' ~ navaid.name ~ ')',
... ...
@@ -144,11 +139,9 @@ displayClass.MFD = {
144 139
         }
145 140
         append(obj_infos, {type: 'separator'});
146 141
         var windowId = obj_infos[0].text;
147
-        var obj_s = size(obj_infos);
148
-        var lines = 9;
149 142
         me.device.windows.draw(
150 143
             windowId,
151
-            {x: 1014 - (name_max_length * 10), y: 778 - ((lines + 3) * 24), w: name_max_length * 10, l: lines, sep: 1},
144
+            {autogeom: 1},
152 145
             obj_infos,
153 146
             {lines: 4, columns: 1}
154 147
         );
... ...
@@ -198,7 +191,7 @@ displayClass.MFD = {
198 191
         var windowId = 'NAVAID INFORMATIONS';
199 192
         me.device.windows.draw(
200 193
             windowId,
201
-            {x: 720, y: 758 - ((lines + 3) * 24), w: 300, l: lines, sep: 1},
194
+            {autogeom: 1},
202 195
             obj_infos
203 196
         );
204 197
         me.device.buttons.CLR = func {
... ...
@@ -250,7 +243,7 @@ displayClass.MFD = {
250 243
         var windowId = 'AIRPORT INFORMATIONS';
251 244
         me.device.windows.draw(
252 245
             windowId,
253
-            {x: 720, y: 758 - ((lines + 3) * 24), w: 300, l: lines, sep: 1},
246
+            {autogeom: 1},
254 247
             obj_infos
255 248
         );
256 249
         me.device.buttons.CLR = func {