选择工具开发一半, 修改新建图层顺序名称

This commit is contained in:
李志鹏
2025-11-07 16:25:41 +08:00
parent 0e565eb0d5
commit 7c340e0cb8
13 changed files with 2198 additions and 8 deletions

View File

@@ -910,6 +910,17 @@ export class LayerManager {
return layer;
}
/**
* 根据name获取图层
* @param {string} layerName 图层名称
* @returns {Object|null} 图层对象或null
*/
getLayerByName(layerName) {
const layer = this.layers.value.find((layer) => layer.name === layerName);
return layer || null;
}
/**
* 获取当前图层对象的列表
* @param {string} layerId 可选指定图层ID默认使用当前活动图层

View File

@@ -181,10 +181,15 @@ export class CanvasEventManager {
setupMouseEvents() {
// 鼠标按下事件
this.canvas.on("mouse:down", (opt) => {
// console.log("==========鼠标按下",opt)
// 平滑停止任何正在进行的惯性动画
this.stopInertiaAnimation(true);
if (
// if (opt.e.which === 3 && this.editorMode === OperationType.SELECT) {
// console.log("==========选择模式鼠标右击画布对象")
// } else
if (
opt.e.altKey ||
opt.e.which === 2 ||
this.editorMode === OperationType.PAN