解决图层选中状态消失问题

This commit is contained in:
李志鹏
2025-11-07 09:43:09 +08:00
parent 1688eb49fa
commit 4c562f93cc
4 changed files with 6 additions and 4 deletions

View File

@@ -589,11 +589,11 @@ function handleLayerClick(layer, event) {
layerManager?.setAllActiveGroupLayerCanvasObject?.(layer);
setActiveLayer(layer.children[0].id, { parentId: layer.id });
} else {
// 选中画布中的图层对象
layerManager?.selectLayerObjects(layer.id);
// 否则直接设置当前图层为活动图层
setActiveLayer(layer.id);
layerManager?.updateLayersObjectsInteractivity();
// 选中画布中的图层对象
layerManager?.selectLayerObjects(layer.id);
}
}
lastSelectedIndex.value = sortableRootLayers.value.findIndex((l) => l.id === layer.id);

View File

@@ -822,8 +822,8 @@ export class CanvasManager {
try {
// 如果当前有选中对象,先清除选中状态 否则导出有问题
this.canvas.discardActiveObject(); // 清除选中状态
this.canvas.renderAll(); // 重新渲染画布
// this.canvas.discardActiveObject(); // 清除选中状态
// this.canvas.renderAll(); // 重新渲染画布
// 自动设置红绿图模式相关参数
const enhancedOptions = {
...options,

View File

@@ -1416,6 +1416,7 @@ export default defineComponent({
display: block;
max-height: 100%;
max-width: 100%;
object-fit: contain;
}
.delete_file_block {

View File

@@ -692,6 +692,7 @@ export default defineComponent({
display: block;
max-height: 100%;
max-width: 100%;
object-fit: contain;
}
&:hover .delete_like_file_block{
// display: block;