fix: correctly handle node wrapper resizing
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m57s
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m57s
This commit is contained in:
@@ -26,15 +26,16 @@ export class GraphState {
|
|||||||
|
|
||||||
constructor(private graph: GraphManager) { }
|
constructor(private graph: GraphManager) { }
|
||||||
|
|
||||||
cameraPosition: [number, number, number] = $state([0, 0, 4]);
|
width = $state(100);
|
||||||
wrapper = $state<HTMLDivElement>(null!);
|
height = $state(100);
|
||||||
|
|
||||||
|
wrapper = $state<HTMLDivElement>(null!);
|
||||||
rect: DOMRect = $derived(
|
rect: DOMRect = $derived(
|
||||||
this.wrapper ? this.wrapper.getBoundingClientRect() : new DOMRect(0, 0, 0, 0),
|
(this.wrapper && this.width && this.height) ? this.wrapper.getBoundingClientRect() : new DOMRect(0, 0, 0, 0),
|
||||||
);
|
);
|
||||||
width = $derived(this.rect?.width ?? 100);
|
|
||||||
height = $derived(this.rect?.height ?? 100);
|
|
||||||
camera = $state<OrthographicCamera>(null!);
|
camera = $state<OrthographicCamera>(null!);
|
||||||
|
cameraPosition: [number, number, number] = $state([0, 0, 4]);
|
||||||
|
|
||||||
clipboard: null | {
|
clipboard: null | {
|
||||||
nodes: Node[];
|
nodes: Node[];
|
||||||
|
|||||||
Reference in New Issue
Block a user