fix
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { fabric } from "fabric-with-all";
|
||||
import { OperationType } from "../utils/layerHelper";
|
||||
|
||||
/**
|
||||
* 笔刷指示器
|
||||
@@ -95,7 +94,6 @@ export class BrushIndicator {
|
||||
* @private
|
||||
*/
|
||||
_syncCanvasProperties() {
|
||||
console.log("==========","笔刷同步大小")
|
||||
if (!this.staticCanvas || !this.canvas) return;
|
||||
|
||||
// 检查是否为笔刷或橡皮擦模式,非相关模式直接返回
|
||||
@@ -105,8 +103,10 @@ export class BrushIndicator {
|
||||
this.canvas.isDrawingMode &&
|
||||
this.canvas.freeDrawingBrush &&
|
||||
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;
|
||||
|
||||
@@ -471,12 +471,8 @@ export class BrushIndicator {
|
||||
* @returns {Boolean} 是否显示
|
||||
*/
|
||||
_shouldShowIndicator() {
|
||||
const isDrawingMode = this.canvas.isDrawingMode;// 检查画布是否在绘图模式
|
||||
const isLiquifyMode = this.canvas.toolId === OperationType.LIQUIFY;// 检查是否在液化模式
|
||||
|
||||
// console.log(`笔刷指示器\n绘图模式:${isDrawingMode}\n液化模式:${isLiquifyMode}`)
|
||||
// 检查画布是否在绘图模式OR液化模式
|
||||
if ([isDrawingMode, isLiquifyMode].every(v => !v)) return false;
|
||||
// 检查画布是否在绘图模式
|
||||
if (!this.canvas.isDrawingMode) return false;
|
||||
|
||||
// 检查是否有笔刷
|
||||
if (!this.canvas.freeDrawingBrush) return false;
|
||||
|
||||
@@ -1192,6 +1192,7 @@ export class ToolManager {
|
||||
if (this.brushIndicator) {
|
||||
this.brushIndicator.dispose();
|
||||
this.brushIndicator = null;
|
||||
console.log("笔刷指示器已清理");
|
||||
}
|
||||
|
||||
// 移除文本编辑相关事件监听器
|
||||
@@ -1385,6 +1386,7 @@ export class ToolManager {
|
||||
if (!this.brushIndicator) return;
|
||||
|
||||
this.brushIndicator.updateSize(size);
|
||||
console.log(`笔刷指示器大小已更新为: ${size}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1395,6 +1397,7 @@ export class ToolManager {
|
||||
if (!this.brushIndicator) return;
|
||||
|
||||
this.brushIndicator.updateColor(color);
|
||||
console.log(`笔刷指示器颜色已更新为: ${color}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user