画布增加的新功能
This commit is contained in:
@@ -18,6 +18,16 @@ export const LayerType = {
|
||||
BACKGROUND: "background", // 背景图层 - 位于固定图层之、普通图层之下
|
||||
};
|
||||
|
||||
/**
|
||||
* 特殊图层ID
|
||||
*/
|
||||
export const SpecialLayerId = {
|
||||
SPECIAL_GROUP: "group_special", // 特殊组
|
||||
COLOR: "special_color", // 颜色图层
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 画布操作模式枚举:draw(绘画)、select(选择)、pan(拖拽)....
|
||||
*/
|
||||
@@ -178,12 +188,17 @@ export function createLayer(options = {}) {
|
||||
locked: options.locked !== undefined ? options.locked : false,
|
||||
opacity: options.opacity !== undefined ? options.opacity : 1.0,
|
||||
blendMode: options.blendMode || BlendMode.NORMAL,
|
||||
isHidenDragHandle: options.isHidenDragHandle || false,
|
||||
isDisableUnlock: options.isDisableUnlock || false,
|
||||
isFixedOther: options.isFixedOther || false,
|
||||
isFixedClipMask: options.isFixedClipMask || false,
|
||||
|
||||
// 确保不是背景图层
|
||||
isBackground: false,
|
||||
|
||||
// Fabric.js 对象列表
|
||||
fabricObjects: options.fabricObjects || [],
|
||||
fabricObject: options.fabricObject || null,
|
||||
|
||||
// 嵌套结构 - 适用于组图层
|
||||
children: options.children || [],
|
||||
|
||||
Reference in New Issue
Block a user