Skip to content

Commit

Permalink
feat: func addFloatDomToPosition may not execute command (#3855)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongz authored Oct 26, 2024
1 parent 065dadc commit e99aec1
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 e99aec1

Please sign in to comment.