印花图层等禁止添加图层
This commit is contained in:
@@ -144,7 +144,7 @@ export class AddLayerCommand extends Command {
|
|||||||
// 先在一级图层中查找
|
// 先在一级图层中查找
|
||||||
for (let i = 0; i < layers.length; i++) {
|
for (let i = 0; i < layers.length; i++) {
|
||||||
const layer = layers[i];
|
const layer = layers[i];
|
||||||
|
if (layer.isPrintTrimsGroup) continue;
|
||||||
if (layer.id === layerId) {
|
if (layer.id === layerId) {
|
||||||
return {
|
return {
|
||||||
layer: layer,
|
layer: layer,
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ export class CreateTextCommand extends Command {
|
|||||||
// 先在一级图层中查找
|
// 先在一级图层中查找
|
||||||
for (let i = 0; i < layers.length; i++) {
|
for (let i = 0; i < layers.length; i++) {
|
||||||
const layer = layers[i];
|
const layer = layers[i];
|
||||||
|
if (layer.isPrintTrimsGroup) continue;
|
||||||
if (layer.id === layerId) {
|
if (layer.id === layerId) {
|
||||||
return {
|
return {
|
||||||
layer: layer,
|
layer: layer,
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ function handleLayerClick(layer, event) {
|
|||||||
if (event.ctrlKey || event.metaKey || event.shiftKey || isMultiSelectMode.value) {
|
if (event.ctrlKey || event.metaKey || event.shiftKey || isMultiSelectMode.value) {
|
||||||
toggleLayerSelection(layer, event);
|
toggleLayerSelection(layer, event);
|
||||||
} else {
|
} else {
|
||||||
if(!layer.isFixedClipMask) lastSelectLayerId.value = layer.id; // 更新最后选中的图层ID
|
if(!layer.isPrintTrimsGroup) lastSelectLayerId.value = layer.id; // 更新最后选中的图层ID
|
||||||
// 普通点击:进入单选模式
|
// 普通点击:进入单选模式
|
||||||
// selectedLayerIds.value = [layer.id];
|
// selectedLayerIds.value = [layer.id];
|
||||||
// isMultiSelectMode.value = false;
|
// isMultiSelectMode.value = false;
|
||||||
@@ -596,7 +596,7 @@ function handleLayerClick(layer, event) {
|
|||||||
layerManager?.updateLayersObjectsInteractivity();
|
layerManager?.updateLayersObjectsInteractivity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!layer.isFixedClipMask) lastSelectedIndex.value = sortableRootLayers.value.findIndex((l) => l.id === layer.id);
|
if(!layer.isPrintTrimsGroup) lastSelectedIndex.value = sortableRootLayers.value.findIndex((l) => l.id === layer.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1644,7 +1644,7 @@ export class CanvasManager {
|
|||||||
fabricObjects: [],
|
fabricObjects: [],
|
||||||
children: children,
|
children: children,
|
||||||
clippingMask: groupRect.toObject(),
|
clippingMask: groupRect.toObject(),
|
||||||
isFixedClipMask: true,
|
isPrintTrimsGroup: true,
|
||||||
specialType: SpecialType.PRINT_TRIMS_G,
|
specialType: SpecialType.PRINT_TRIMS_G,
|
||||||
});
|
});
|
||||||
this.layers.value.splice(groupIndex, 0, groupLayer);
|
this.layers.value.splice(groupIndex, 0, groupLayer);
|
||||||
|
|||||||
@@ -3271,7 +3271,7 @@ export class LayerManager {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_setupGroupMaskMovementSync(activeSelection, layer) {
|
_setupGroupMaskMovementSync(activeSelection, layer) {
|
||||||
if (!activeSelection || !layer || !layer.clippingMask || layer.isFixedClipMask) {
|
if (!activeSelection || !layer || !layer.clippingMask || layer.isPrintTrimsGroup) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export function createLayer(options = {}) {
|
|||||||
isHidenDragHandle: options.isHidenDragHandle || false,
|
isHidenDragHandle: options.isHidenDragHandle || false,
|
||||||
isDisableUnlock: options.isDisableUnlock || false,
|
isDisableUnlock: options.isDisableUnlock || false,
|
||||||
isFixedOther: options.isFixedOther || false,
|
isFixedOther: options.isFixedOther || false,
|
||||||
isFixedClipMask: options.isFixedClipMask || false,
|
isPrintTrimsGroup: options.isPrintTrimsGroup || false,
|
||||||
|
|
||||||
// 确保不是背景图层
|
// 确保不是背景图层
|
||||||
isBackground: false,
|
isBackground: false,
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export function simplifyLayers(layers, excludedLayers = []) {
|
|||||||
isBackground: layer.isBackground || false,
|
isBackground: layer.isBackground || false,
|
||||||
isFixed: layer.isFixed || false,
|
isFixed: layer.isFixed || false,
|
||||||
isFixedOther: layer.isFixedOther || false,
|
isFixedOther: layer.isFixedOther || false,
|
||||||
isFixedClipMask: layer.isFixedClipMask || false,
|
isPrintTrimsGroup: layer.isPrintTrimsGroup || false,
|
||||||
isHidenDragHandle: layer.isHidenDragHandle || false,
|
isHidenDragHandle: layer.isHidenDragHandle || false,
|
||||||
isDisableUnlock: layer.isDisableUnlock || false,
|
isDisableUnlock: layer.isDisableUnlock || false,
|
||||||
clippingMask:
|
clippingMask:
|
||||||
|
|||||||
@@ -191,6 +191,7 @@
|
|||||||
};
|
};
|
||||||
const setFill = async (item) => {
|
const setFill = async (item) => {
|
||||||
if (!item) return null;
|
if (!item) return null;
|
||||||
|
console.log(item.scale);
|
||||||
const cwidth = canvas.width;
|
const cwidth = canvas.width;
|
||||||
const cheight = canvas.height;
|
const cheight = canvas.height;
|
||||||
let image = await urlToCanvas(item.path);
|
let image = await urlToCanvas(item.path);
|
||||||
|
|||||||
Reference in New Issue
Block a user