From 2ddcaad6fe38d456989063ce934213fb3c4adb3e Mon Sep 17 00:00:00 2001 From: Adam Obuchowicz Date: Thu, 23 Nov 2023 12:03:23 +0100 Subject: [PATCH] Fix startup in the electron package (#8365) Fixes #8334 There were two issues: one is bad code generated by vite. I needed to rephrase Rect.Zero definition. The second were missing widgets - that was caused by the fact that Vue components have a bit different properties than on test builds, apparently. --- app/gui2/src/providers/widgetRegistry.ts | 2 +- app/gui2/src/util/rect.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/gui2/src/providers/widgetRegistry.ts b/app/gui2/src/providers/widgetRegistry.ts index f2b2bba2e10..72594479cda 100644 --- a/app/gui2/src/providers/widgetRegistry.ts +++ b/app/gui2/src/providers/widgetRegistry.ts @@ -162,7 +162,7 @@ function isWidgetModule(module: unknown): module is WidgetModule { } function isWidgetComponent(component: unknown): component is WidgetComponent { - return typeof component === 'object' && component !== null && 'render' in component + return typeof component === 'object' && component !== null } function isWidgetDefinition(config: unknown): config is WidgetDefinition { diff --git a/app/gui2/src/util/rect.ts b/app/gui2/src/util/rect.ts index 7ff745aea07..3201012acc8 100644 --- a/app/gui2/src/util/rect.ts +++ b/app/gui2/src/util/rect.ts @@ -9,7 +9,7 @@ export class Rect { readonly size: Vec2, ) {} - static Zero = new Rect(Vec2.Zero, Vec2.Zero) + static Zero: Rect static XYWH(x: number, y: number, w: number, h: number): Rect { return new Rect(new Vec2(x, y), new Vec2(w, h)) @@ -80,3 +80,5 @@ export class Rect { return this.intersectsX(other) && this.intersectsY(other) } } + +Rect.Zero = new Rect(Vec2.Zero, Vec2.Zero)