接入画布
This commit is contained in:
32
src/component/Canvas/CanvasEditor/config/canvasConfig.js
Normal file
32
src/component/Canvas/CanvasEditor/config/canvasConfig.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { OperationType } from "../utils/layerHelper";
|
||||
|
||||
// 画布默认配置
|
||||
export const canvasConfig = {
|
||||
width: 1024, // 画布宽度
|
||||
height: 1024, // 画布高度
|
||||
backgroundColor: "#ffffff", // 背景颜色
|
||||
objectCaching: true, // 是否启用对象缓存
|
||||
enableRetinaScaling: true, // 是否启用视网膜缩放
|
||||
brushWidth: 5, // 画笔宽度
|
||||
brushOpacity: 1, // 画笔透明度
|
||||
brushColor: "#000000", // 画笔颜色
|
||||
brushType: "pencil", // 画笔类型
|
||||
brushTypeList: [
|
||||
{ name: "pencil", text: "铅笔" },
|
||||
// { name: "eraser", text: "橡皮擦" },
|
||||
{ name: "brush", text: "画笔" },
|
||||
{ name: "spray", text: "喷枪" },
|
||||
{ name: "rectangle", text: "矩形" },
|
||||
{ name: "circle", text: "圆形" },
|
||||
], // 画笔类型列表
|
||||
layerWidth: 250, // 图层宽度
|
||||
|
||||
// History settings
|
||||
maxHistorySteps: 50, // 最大历史记录步数
|
||||
onlyActiveLayerEditable: false, // 是否只有当前活动图层可编辑
|
||||
// 默认工具模式
|
||||
defaultTool: OperationType.DRAW || OperationType.SELECT, // 默认工具 TODO: 默认的地方可以陆续改成这个
|
||||
isCropBackground: true, // 是否要裁剪背景层以外的内容
|
||||
};
|
||||
|
||||
export default canvasConfig;
|
||||
Reference in New Issue
Block a user