doouding
2025-01-20 09:25:05 +00:00
parent cb53baca89
commit 1560880abd
10 changed files with 83 additions and 160 deletions

View File

@@ -98,6 +98,10 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
this._hideOutsideBlock();
};
if (!this.enableChildrenSchedule) {
delete this.scheduleUpdateChildren;
}
viewportUpdateCallback();
this.disposables.add(
this.viewport.viewportUpdated.on(() => viewportUpdateCallback())
@@ -111,7 +115,7 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
return html``;
}
scheduleUpdateChildren(id: string) {
scheduleUpdateChildren? = (id: string) => {
const { promise, resolve } = Promise.withResolvers<void>();
this._pendingChildrenUpdates.push({ id, resolve });
@@ -143,7 +147,7 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
}
return promise;
}
};
@property({ attribute: false })
accessor getModelsInViewport: undefined | (() => Set<GfxBlockElementModel>);
@@ -154,6 +158,9 @@ export class GfxViewportElement extends WithDisposable(ShadowlessElement) {
@property({ type: Number })
accessor maxConcurrentRenders: number = 2;
@property({ attribute: false })
accessor enableChildrenSchedule: boolean = true;
@property({ attribute: false })
accessor viewport!: Viewport;
}