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