This commit is contained in:
李志鹏
2025-09-27 13:56:13 +08:00
parent aa47c91238
commit 93c49292b9
4 changed files with 9 additions and 17 deletions

6
components.d.ts vendored
View File

@@ -9,10 +9,8 @@ export {}
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
ABadge: typeof import('ant-design-vue/es')['Badge'] ABadge: typeof import('ant-design-vue/es')['Badge']
ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb']
ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider'] AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADatePicker: typeof import('ant-design-vue/es')['DatePicker']
ADrawer: typeof import('ant-design-vue/es')['Drawer'] ADrawer: typeof import('ant-design-vue/es')['Drawer']
ADropdown: typeof import('ant-design-vue/es')['Dropdown'] ADropdown: typeof import('ant-design-vue/es')['Dropdown']
AImage: typeof import('ant-design-vue/es')['Image'] AImage: typeof import('ant-design-vue/es')['Image']
@@ -20,21 +18,17 @@ declare module 'vue' {
AMenu: typeof import('ant-design-vue/es')['Menu'] AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal'] AModal: typeof import('ant-design-vue/es')['Modal']
APagination: typeof import('ant-design-vue/es')['Pagination']
APopover: typeof import('ant-design-vue/es')['Popover'] APopover: typeof import('ant-design-vue/es')['Popover']
ARangePicker: typeof import('ant-design-vue/es')['RangePicker'] ARangePicker: typeof import('ant-design-vue/es')['RangePicker']
ASelect: typeof import('ant-design-vue/es')['Select'] ASelect: typeof import('ant-design-vue/es')['Select']
ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
ASlider: typeof import('ant-design-vue/es')['Slider'] ASlider: typeof import('ant-design-vue/es')['Slider']
ASpace: typeof import('ant-design-vue/es')['Space']
ASpin: typeof import('ant-design-vue/es')['Spin'] ASpin: typeof import('ant-design-vue/es')['Spin']
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']
ASwitch: typeof import('ant-design-vue/es')['Switch'] ASwitch: typeof import('ant-design-vue/es')['Switch']
ATable: typeof import('ant-design-vue/es')['Table'] ATable: typeof import('ant-design-vue/es')['Table']
ATabPane: typeof import('ant-design-vue/es')['TabPane'] ATabPane: typeof import('ant-design-vue/es')['TabPane']
ATabs: typeof import('ant-design-vue/es')['Tabs'] ATabs: typeof import('ant-design-vue/es')['Tabs']
AUpload: typeof import('ant-design-vue/es')['Upload'] AUpload: typeof import('ant-design-vue/es')['Upload']
ElCascader: typeof import('element-plus/es')['ElCascader']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
} }

View File

@@ -581,7 +581,6 @@ function zoomOut() {
x: canvasManager.canvas.width / 2, x: canvasManager.canvas.width / 2,
y: canvasManager.canvas.height / 2, y: canvasManager.canvas.height / 2,
}; };
canvasManager.animateZoom(centerPoint, newZoom); canvasManager.animateZoom(centerPoint, newZoom);
} }

View File

@@ -1,5 +1,4 @@
import { fabric } from "fabric-with-all"; import { fabric } from "fabric-with-all";
import { OperationType } from "../utils/layerHelper";
/** /**
* 笔刷指示器 * 笔刷指示器
@@ -95,7 +94,6 @@ export class BrushIndicator {
* @private * @private
*/ */
_syncCanvasProperties() { _syncCanvasProperties() {
console.log("==========","笔刷同步大小")
if (!this.staticCanvas || !this.canvas) return; if (!this.staticCanvas || !this.canvas) return;
// 检查是否为笔刷或橡皮擦模式,非相关模式直接返回 // 检查是否为笔刷或橡皮擦模式,非相关模式直接返回
@@ -105,8 +103,10 @@ export class BrushIndicator {
this.canvas.isDrawingMode && this.canvas.isDrawingMode &&
this.canvas.freeDrawingBrush && this.canvas.freeDrawingBrush &&
this.canvas.freeDrawingBrush.type === "eraser"; this.canvas.freeDrawingBrush.type === "eraser";
const isLiquifyMode = this.canvas.toolId === OperationType.LIQUIFY;// 检查是否在液化模式
if ([isBrushMode,isEraserMode,isLiquifyMode].every(v => !v)) return; if (!isBrushMode && !isEraserMode) {
return;
}
let hasChanges = false; let hasChanges = false;
@@ -471,12 +471,8 @@ export class BrushIndicator {
* @returns {Boolean} 是否显示 * @returns {Boolean} 是否显示
*/ */
_shouldShowIndicator() { _shouldShowIndicator() {
const isDrawingMode = this.canvas.isDrawingMode;// 检查画布是否在绘图模式 // 检查画布是否在绘图模式
const isLiquifyMode = this.canvas.toolId === OperationType.LIQUIFY;// 检查是否在液化模式 if (!this.canvas.isDrawingMode) return false;
// console.log(`笔刷指示器\n绘图模式:${isDrawingMode}\n液化模式:${isLiquifyMode}`)
// 检查画布是否在绘图模式OR液化模式
if ([isDrawingMode, isLiquifyMode].every(v => !v)) return false;
// 检查是否有笔刷 // 检查是否有笔刷
if (!this.canvas.freeDrawingBrush) return false; if (!this.canvas.freeDrawingBrush) return false;

View File

@@ -1192,6 +1192,7 @@ export class ToolManager {
if (this.brushIndicator) { if (this.brushIndicator) {
this.brushIndicator.dispose(); this.brushIndicator.dispose();
this.brushIndicator = null; this.brushIndicator = null;
console.log("笔刷指示器已清理");
} }
// 移除文本编辑相关事件监听器 // 移除文本编辑相关事件监听器
@@ -1385,6 +1386,7 @@ export class ToolManager {
if (!this.brushIndicator) return; if (!this.brushIndicator) return;
this.brushIndicator.updateSize(size); this.brushIndicator.updateSize(size);
console.log(`笔刷指示器大小已更新为: ${size}`);
} }
/** /**
@@ -1395,6 +1397,7 @@ export class ToolManager {
if (!this.brushIndicator) return; if (!this.brushIndicator) return;
this.brushIndicator.updateColor(color); this.brushIndicator.updateColor(color);
console.log(`笔刷指示器颜色已更新为: ${color}`);
} }
/** /**