feat(CanvasManager): enhance image layer management and event handling
This commit is contained in:
@@ -569,7 +569,7 @@ export class LayerManager {
|
||||
* @param {string} layerId 目标图层ID,如果不提供则使用当前活动图层
|
||||
* @returns {Object} 添加的对象
|
||||
*/
|
||||
addObjectToLayer(fabricObject, layerId = null) {
|
||||
addObjectToLayer(fabricObject, layerId = null, options = {}) {
|
||||
const targetLayerId = layerId || this.activeLayerId.value;
|
||||
|
||||
// 如果没有指定图层ID,也没有活动图层,则返回错误
|
||||
@@ -597,6 +597,9 @@ export class LayerManager {
|
||||
layerManager: this,
|
||||
});
|
||||
|
||||
// 设置命令的撤销状态
|
||||
if (isBoolean(options.undoable)) command.undoable = options.undoable; // 是否撤销
|
||||
|
||||
// 执行命令
|
||||
if (this.commandManager) {
|
||||
this.commandManager.execute(command);
|
||||
|
||||
Reference in New Issue
Block a user