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: document size do not affected by overflow (#4940)

lumix6132592891cc
diff --git a/packages/engine-render/src/components/sheets/extensions/font.ts b/packages/engine-render/src/components/sheets/extensions/font.ts
index 7d5aad1f4d..d9f60046af 100644
--- a/packages/engine-render/src/components/sheets/extensions/font.ts
+++ b/packages/engine-render/src/components/sheets/extensions/font.ts
@@ -459,6 +459,9 @@ export class Font extends SheetExtension {
const documentDataModel = documentSkeleton.getViewModel().getDataModel();
let { startX, startY, endX, endY } = renderFontCtx;
+ const cellWidth = endX - startX;
+ const cellHeight = endY - startY;
+
// WRAP means next line
if (wrapStrategy === WrapStrategy.WRAP && vertexAngle === 0) {
documentDataModel.updateDocumentDataPageSize(endX - startX);
@@ -503,7 +506,7 @@ export class Font extends SheetExtension {
bottom: endY - startY,
};
documentSkeleton.makeDirty(false);
- documents.resize(endX - startX, endY - startY);
+ documents.resize(cellWidth, cellHeight);
documents.changeSkeleton(documentSkeleton).render(ctx, {
viewBound: {
left: 0,