mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-23 23:57:23 +01:00
feat: Enhance WebGL2LayerFramework initialization and improve global variable handling
This commit is contained in:
parent
2dae325d05
commit
8560c131eb
6 changed files with 202 additions and 147 deletions
|
|
@ -102,12 +102,7 @@ Reads window globals (`viewX`, `viewY`, `scale`, `graphWidth`, `graphHeight`) an
|
|||
|
||||
```typescript
|
||||
syncTransform(): void {
|
||||
if (this._fallback || !this.camera) return;
|
||||
const viewX = (globalThis as any).viewX ?? 0;
|
||||
const viewY = (globalThis as any).viewY ?? 0;
|
||||
const scale = (globalThis as any).scale ?? 1;
|
||||
const graphWidth = (globalThis as any).graphWidth ?? 960;
|
||||
const graphHeight = (globalThis as any).graphHeight ?? 540;
|
||||
if (this._fallback || !this.camera) return
|
||||
const bounds = buildCameraBounds(viewX, viewY, scale, graphWidth, graphHeight);
|
||||
this.camera.left = bounds.left;
|
||||
this.camera.right = bounds.right;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue