Skip to content

Commit

Permalink
fix(fma): add smaller font size & center CLB
Browse files Browse the repository at this point in the history
  • Loading branch information
BravoMike99 committed Sep 28, 2023
1 parent 1275896 commit 873e21b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 9 additions & 4 deletions fbw-a32nx/src/systems/instruments/src/PFD/FMA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ class B2Cell extends DisplayComponent<CellProps> {

private classSub = Subject.create('');

private xposSub = Subject.create(0);

onAfterRender(node: VNode): void {
super.onAfterRender(node);

Expand All @@ -905,6 +907,7 @@ class B2Cell extends DisplayComponent<CellProps> {
let color1 = 'Cyan';
if (clbArmed) {
text1 = 'CLB';
this.xposSub.set(49.921795);
} else if (desArmed) {
text1 = 'DES';
} else if (altCstArmed) {
Expand All @@ -925,17 +928,19 @@ class B2Cell extends DisplayComponent<CellProps> {
text2 = '';
}

// CLB armed should be centered, other modes are aligned to the left on newer DMCs
this.xposSub.set(clbArmed ? 49.921795 : 41.477474);
this.text1Sub.set(text1);
this.text2Sub.set(text2);
this.classSub.set(`FontMedium MiddleAlign ${color1}`);
this.classSub.set(`FontMediumSmaller MiddleAlign ${color1}`);
});
}

render(): VNode {
return (
<g>
<text class={this.classSub} x="41.477474" y="14.329653">{this.text1Sub}</text>
<text class="FontMedium MiddleAlign Cyan" x="54.59803" y="14.382949">{this.text2Sub}</text>
<text class={this.classSub} x={this.xposSub} y="14.329653">{this.text1Sub}</text>
<text class="FontMediumSmaller MiddleAlign Cyan" x="54.59803" y="14.382949">{this.text2Sub}</text>
</g>
);
}
Expand Down Expand Up @@ -1118,7 +1123,7 @@ class C2Cell extends DisplayComponent<CellProps> {

render(): VNode {
return (
<text class="FontMedium MiddleAlign Cyan" x="84.734184" y="14.440415">{this.textSub}</text>
<text class="FontMediumSmaller MiddleAlign Cyan" x="84.734184" y="14.440415">{this.textSub}</text>
);
}
}
Expand Down
4 changes: 4 additions & 0 deletions fbw-a32nx/src/systems/instruments/src/PFD/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
font-size: 6px;
}

.FontMediumSmaller {
font-size: 5.3px;
}

.FontSmall {
font-size: 5px;
}
Expand Down

0 comments on commit 873e21b

Please sign in to comment.