flx
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { fabric } from "fabric-with-all";
|
import { fabric } from "fabric-with-all";
|
||||||
|
import { OperationType } from "../utils/layerHelper";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 笔刷指示器
|
* 笔刷指示器
|
||||||
@@ -104,9 +105,8 @@ export class BrushIndicator {
|
|||||||
this.canvas.freeDrawingBrush &&
|
this.canvas.freeDrawingBrush &&
|
||||||
this.canvas.freeDrawingBrush.type === "eraser";
|
this.canvas.freeDrawingBrush.type === "eraser";
|
||||||
|
|
||||||
if (!isBrushMode && !isEraserMode) {
|
const isLiquifyMode = this.canvas.toolId === OperationType.LIQUIFY;// 检查是否在液化模式
|
||||||
return;
|
if ([isBrushMode, isEraserMode, isLiquifyMode].every(v => !v)) return;
|
||||||
}
|
|
||||||
|
|
||||||
let hasChanges = false;
|
let hasChanges = false;
|
||||||
|
|
||||||
@@ -471,9 +471,12 @@ export class BrushIndicator {
|
|||||||
* @returns {Boolean} 是否显示
|
* @returns {Boolean} 是否显示
|
||||||
*/
|
*/
|
||||||
_shouldShowIndicator() {
|
_shouldShowIndicator() {
|
||||||
// 检查画布是否在绘图模式
|
const isDrawingMode = this.canvas.isDrawingMode;// 检查画布是否在绘图模式
|
||||||
if (!this.canvas.isDrawingMode) return false;
|
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.freeDrawingBrush) return false;
|
if (!this.canvas.freeDrawingBrush) return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user