Skip to content

Commit

Permalink
prettify & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wallabra committed Nov 12, 2024
1 parent fe355c5 commit a041439
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ class FpsCounter extends CanvasLabel {
dockY: "start",
dockMarginX: 25,
dockMarginY: 20,
textAlign: "end",
color: "#ff08",
...args,
});
Expand Down Expand Up @@ -1191,7 +1190,6 @@ class HudCounters {
autoFont: true,
font: "$Hpx sans-serif",
height: 12,
textAlign: "start",
};

new CanvasLabel({
Expand Down
10 changes: 3 additions & 7 deletions src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export function computeDock(
}

export function getTextAlign(align: UIAlign): CanvasTextAlign {
return align === 'start' ? 'start' : align === 'end' ? 'end' : 'center';
return align === "start" ? "start" : align === "end" ? "end" : "center";
}

export function getTextBaseline(align: UIAlign): CanvasTextBaseline {
return align === 'start' ? 'top' : align === 'end' ? 'bottom' : 'middle';
return align === "start" ? "top" : align === "end" ? "bottom" : "middle";
}

export function computeAlign(align: UIAlign, base: number, offset: number) {
Expand Down Expand Up @@ -816,11 +816,7 @@ export class CanvasLabel extends CanvasUIElement<CanvasLabelArgs> {
pos.x = computeDock(this.dockX, pos.x, this.innerWidth, 0);
pos.y = computeDock(this.dockY, pos.y, this.innerHeight, 0);

ctx.fillText(
this.label,
pos.x,
pos.y,
);
ctx.fillText(this.label, pos.x, pos.y);
}

event() {
Expand Down

0 comments on commit a041439

Please sign in to comment.