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: fix the issue of document float images failing to render (#6616)

wpxp123456f6af79062b81
diff --git a/packages/drawing-ui/src/services/drawing-render.service.ts b/packages/drawing-ui/src/services/drawing-render.service.ts
index 8f228fde4a..0ec4e6fdae 100644
--- a/packages/drawing-ui/src/services/drawing-render.service.ts
+++ b/packages/drawing-ui/src/services/drawing-render.service.ts
@@ -50,6 +50,7 @@ export class DrawingRenderService {
isMultiTransform,
transforms: multiTransforms,
} = imageParam;
+
if (drawingType !== DrawingTypeEnum.DRAWING_IMAGE) {
return;
}
@@ -58,32 +59,28 @@ export class DrawingRenderService {
return;
}
+ if (this._univerInstanceService.getUnitType(unitId) === UniverInstanceType.UNIVER_SHEET && subUnitId !== this._getActiveSheetId()) {
+ return;
+ }
+
if (singleTransform == null) {
return;
}
const transforms = isMultiTransform && multiTransforms ? multiTransforms : [singleTransform];
-
const images = [];
+
for (const transform of transforms) {
const { left, top, width, height, angle, flipX, flipY, skewX, skewY } = transform;
const index = transforms.indexOf(transform);
const imageShapeKey = getDrawingShapeKeyByDrawingSearch({ unitId, subUnitId, drawingId }, isMultiTransform ? index : undefined);
- const imageShape = scene.getObject(imageShapeKey);
+ const imageShape = scene.getObject(imageShapeKey);
if (imageShape != null) {
imageShape.transformByState({ left, top, width, height, angle, flipX, flipY, skewX, skewY });
continue;
}
- if (!this._drawingManagerService.getDrawingVisible()) {
- continue;
- }
-
- if (subUnitId !== this._getActiveSheetId()) {
- continue;
- }
-
const orders = this._drawingManagerService.getDrawingOrder(unitId, subUnitId);
const zIndex = orders.indexOf(drawingId);
const imageConfig: IImageProps = { ...transform, zIndex: zIndex === -1 ? (orders.length - 1) : zIndex };