fix: 添加液化操作错误提示,优化用户体验,修复液化点击空白区域液化效果被重置的问题
This commit is contained in:
@@ -138,6 +138,7 @@ import {
|
||||
import { OperationType } from "../utils/layerHelper";
|
||||
import { LiquifyRealTimeUpdater } from "../managers/liquify/LiquifyRealTimeUpdater";
|
||||
import { LiquifyStateManager } from "../managers/liquify/LiquifyStateManager";
|
||||
import { Modal } from "ant-design-vue";
|
||||
|
||||
// Props定义
|
||||
const props = defineProps({
|
||||
@@ -431,7 +432,19 @@ function showPanel(event) {
|
||||
if (!detail.canLiquify && !detail.targetObject) {
|
||||
if (detail.layerStatus && detail.layerStatus.message) {
|
||||
console.log("液化操作提示:", detail.layerStatus.message);
|
||||
Modal.error({
|
||||
title: "错误提示",
|
||||
content: detail.layerStatus.message,
|
||||
okText: "确定",
|
||||
centered: true,
|
||||
});
|
||||
} else {
|
||||
Modal.error({
|
||||
title: "错误提示",
|
||||
content: "未选择有效图像或图层不适合液化操作",
|
||||
okText: "确定",
|
||||
centered: true,
|
||||
});
|
||||
console.log("未选择有效图像或图层不适合液化操作");
|
||||
}
|
||||
visible.value = true; // 仍然显示面板以便用户看到提示
|
||||
@@ -868,8 +881,6 @@ async function handleMouseDown(event) {
|
||||
console.log(
|
||||
`开始液化操作,图像坐标: (${imageCoords.x}, ${imageCoords.y})`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 应用液化效果
|
||||
applyLiquifyAtPoint(pointer.x, pointer.y);
|
||||
@@ -880,6 +891,8 @@ async function handleMouseDown(event) {
|
||||
pressX.value = pointer.x;
|
||||
pressY.value = pointer.y;
|
||||
startPressTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user