Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(doc): only doc need to call scene resize (#784)

Ran Luo2a86ffeff5f3
diff --git a/packages/docs/src/controllers/doc-render.controller.ts b/packages/docs/src/controllers/doc-render.controller.ts
index 4a33f395fd..842c726931 100644
--- a/packages/docs/src/controllers/doc-render.controller.ts
+++ b/packages/docs/src/controllers/doc-render.controller.ts
@@ -154,7 +154,12 @@ export class DocRenderController extends Disposable {
}
docsComponent.resize(width, height);
- scene.resize(width, height);
+
+ const excludeUnitList = [DOCS_NORMAL_EDITOR_UNIT_ID_KEY, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY];
+
+ if (!excludeUnitList.includes(currentRender.unitId)) {
+ scene.resize(width, height);
+ }
}
private _commandExecutedListener() {