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.
This commit is contained in:
Adam Obuchowicz 2023-11-23 12:03:23 +01:00 committed by GitHub
parent fbe4221c46
commit 2ddcaad6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -162,7 +162,7 @@ function isWidgetModule(module: unknown): module is WidgetModule<any> {
}
function isWidgetComponent(component: unknown): component is WidgetComponent<any> {
return typeof component === 'object' && component !== null && 'render' in component
return typeof component === 'object' && component !== null
}
function isWidgetDefinition(config: unknown): config is WidgetDefinition<any> {

View File

@ -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)