调整detail拉伸sketch但是编辑印花和画布使用的sketch不受影响

This commit is contained in:
X1627315083
2025-09-22 10:29:27 +08:00
parent a1bbc2d166
commit ddcad3c391
24 changed files with 234 additions and 82 deletions

View File

@@ -759,13 +759,13 @@ export class ToolManager {
* @private
*/
_showRasterizeConfirmModal(isGroup, layerId) {
const title = "栅格化图层";
const content = "需要先栅格化才能进行液化操作,是否立即栅格化?";
const title = this.t("Canvas.RasterizedLayer");
const content = this.t("Canvas.rasterizeImmediately");
Modal.confirm({
title,
content,
okText: "确定栅格化",
okText: this.t("Canvas.ConfirmRasterization"),
cancelText: "取消",
centered: true,
icon: h("span", { style: "color: #faad14;" }, "⚠️"),
@@ -800,8 +800,8 @@ export class ToolManager {
if (!this.commandManager || !this.layerManager) return;
// 显示加载Modal
const loadingModal = Modal.info({
title: "正在栅格化",
content: "正在栅格化图层,请稍候...",
title: this.t('Canvas.beingRasterized'),
content: this.t('Canvas.waitRasterizing'),
okButtonProps: { style: { display: "none" } },
centered: true,
closable: false,
@@ -823,16 +823,16 @@ export class ToolManager {
if (result) {
// 栅格化成功,启动液化
message.success("图层已成功栅格化,可以进行液化操作");
message.success(this.t('Canvas.successRasterizing'));
this._startLiquify(result);
this.setTool(OperationType.LIQUIFY); // 切换到液化工具
} else {
// 栅格化失败
Modal.error({
title: "栅格化失败",
content: "栅格化失败,无法进行液化操作",
okText: "确定",
title: this.t('Canvas.gridingFailed'),
content: this.t('Canvas.gridingFailedNoOperation'),
okText: this.t('Canvas.ok'),
centered: true,
});
}
@@ -840,9 +840,9 @@ export class ToolManager {
console.error("栅格化图层失败:", error);
Modal.error({
title: "栅格化错误",
content: `栅格化失败${error.message}`,
okText: "确定",
title: this.t('Canvas.gridingError'),
content: `${this.t('Canvas.gridingFailed')}${error.message}`,
okText: this.t('Canvas.ok'),
centered: true,
});
} finally {
@@ -866,9 +866,9 @@ export class ToolManager {
);
if (!layer) {
Modal.error({
title: "图层错误",
content: "图层不存在",
okText: "确定",
title: this.t('Canvas.LayerError'),
content: this.t('Canvas.LayerDoesNotExist'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -880,9 +880,9 @@ export class ToolManager {
// 背景图层使用 fabricObject (单数)
if (!layer.fabricObject) {
Modal.warning({
title: "背景图层为空",
content: "背景图层为空,无法进行液化操作",
okText: "确定",
title: this.t('Canvas.backgroundEmpty'),
content: this.t('Canvas.backgroundEmptyNoLiquidation'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -892,9 +892,9 @@ export class ToolManager {
// 普通图层使用 fabricObjects (复数)
if (!layer.fabricObjects || layer.fabricObjects.length === 0) {
Modal.warning({
title: "图层为空",
content: "图层为空,无法进行液化操作",
okText: "确定",
title: this.t('Canvas.layerEmpty'),
content: this.t('Canvas.layerEmptyNoLiquidation'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -906,9 +906,9 @@ export class ToolManager {
const liquifyManager = this.canvasManager?.liquifyManager;
if (!liquifyManager) {
Modal.error({
title: "液化管理器错误",
content: "液化管理器未初始化",
okText: "确定",
title: this.t('Canvas.liqueficationManagerError'),
content: this.t('Canvas.liqueficationManagerErrorInitialized'),
okText: this.t('Canvas.ok'),
centered: true,
});
return;
@@ -917,8 +917,8 @@ export class ToolManager {
try {
// 显示准备中的Modal
const preparingModal = Modal.info({
title: "准备液化环境",
content: "正在准备液化环境,请稍候...",
title: this.t('Canvas.liquefactionEnvironment'),
content: this.t('Canvas.liquefactionEnvironmentLoading'),
okButtonProps: { style: { display: "none" } },
centered: true,
closable: false,
@@ -963,9 +963,9 @@ export class ToolManager {
} catch (error) {
console.error("启动液化工具失败:", error);
Modal.error({
title: "液化工具启动失败",
content: `启动液化工具失败:${error.message}`,
okText: "确定",
title: this.t('Canvas.LiqueficationFailed'),
content: `${this.t('Canvas.LiqueficationFailed')}:${error.message}`,
okText: this.t('Canvas.ok'),
centered: true,
});
}
@@ -1041,7 +1041,7 @@ export class ToolManager {
_createTextDirect(x, y, options = {}) {
// 默认文本属性
const defaultOptions = {
text: "双击编辑文本",
text: this.t('Canvas.DoubleClickText'),
fontFamily: "Arial",
fontSize: 24,
fontWeight: "normal",