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(sheets-ui): fix doc drawing skeleton calc wrong (#6747)

Shiyun Hua3bf7f2dafd50
diff --git a/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts b/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts
index 9fbffb7fce..d3356c0794 100644
--- a/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts
+++ b/packages/sheets-ui/src/services/utils/doc-skeleton-util.ts
@@ -145,10 +145,10 @@ export const calculateDocSkeletonRects = (docSkeleton: DocumentSkeleton, padding
? Array.from(drawings.keys()).map((key) => ({
drawingId: key,
rect: {
- top: drawings!.get(key)!.aTop,
- bottom: drawings!.get(key)!.aTop + drawings!.get(key)!.width,
- left: drawings!.get(key)!.aLeft,
- right: drawings!.get(key)!.aLeft + drawings!.get(key)!.height,
+ top: drawings!.get(key)!.aTop + paddingTop,
+ bottom: drawings!.get(key)!.aTop + drawings!.get(key)!.height + paddingTop,
+ left: drawings!.get(key)!.aLeft + paddingLeft,
+ right: drawings!.get(key)!.aLeft + drawings!.get(key)!.width + paddingLeft,
},
drawing: drawings.get(key)!,
}))