fix: resize hud

This commit is contained in:
Piotr Goszczyński committed 2025-03-19 14:50:14 +01:00
1 parent 282f34dce1
commit fa399b303c
2 files changed
+7 -2

No files matched your search

@@ -17,7 +17,7 @@ const TicketLayoutCanvasCorner = ({ className }: { className?: string }) => {
export const TicketLayoutCanvas = ({ children }: { children: ReactNode }) => {
return (
<div className="relative w-full aspect-[1.5841584158] border border-neutral-600">
<div className="relative w-full h-[397px] lg:h-auto lg:aspect-[1.5841584158] border border-neutral-600">
<TicketLayoutCanvasCorner className="top-[-1px] left-[-1px] -rotate-90"></TicketLayoutCanvasCorner>
<TicketLayoutCanvasCorner className="top-[-1px] right-[-1px]"></TicketLayoutCanvasCorner>
<TicketLayoutCanvasCorner className="bottom-[-1px] left-[-1px] rotate-180"></TicketLayoutCanvasCorner>
@@ -545,7 +545,12 @@ class HUDScene implements BaseScene {
}
private repositionHudElements(): void {
if (!this.hudGroup) return
if (!this.hudGroup || !this.hudMesh) return
// Update the plane geometry with new dimensions
this.hudMesh.geometry.dispose(); // Dispose of the old geometry
this.hudPlane = new THREE.PlaneGeometry(this.width, this.height);
this.hudMesh.geometry = this.hudPlane;
}
private getSize(num: number, axis: 'y' | 'x') {