Skip to content

Commit

Permalink
feat: func addFloatDomToPosition may not execute command
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongz committed Oct 25, 2024
1 parent ff9cf49 commit b59c080
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ export class SheetCanvasFloatDomManagerService extends Disposable {
);
}

addFloatDomToPosition(layer: ICanvasFloatDom, propId?: string) {
addFloatDomToPosition(layer: ICanvasFloatDom, propId?: string, executeCommand = true) {
const target = getSheetCommandTarget(this._univerInstanceService, {
unitId: layer.unitId,
subUnitId: layer.subUnitId,
Expand Down Expand Up @@ -528,17 +528,18 @@ export class SheetCanvasFloatDomManagerService extends Disposable {
data,
allowTransform,
};

this._commandService.executeCommand(InsertSheetDrawingCommand.id, {
unitId,
drawings: [sheetDrawingParam],
} as IInsertDrawingCommandParams);

if (executeCommand) {
this._commandService.executeCommand(InsertSheetDrawingCommand.id, {
unitId,
drawings: [sheetDrawingParam],
} as IInsertDrawingCommandParams);
}
return {
id,
dispose: () => {
this._removeDom(id, true);
},
sheetDrawingParam,
};
}

Expand Down

0 comments on commit b59c080

Please sign in to comment.