元素默认正常模式
This commit is contained in:
@@ -1458,7 +1458,7 @@ export class CanvasManager {
|
||||
|
||||
const printTrimsLayers = [];// 印花和元素图层
|
||||
const singleLayers = [];// 平铺图层
|
||||
otherData_.printObject?.prints?.forEach((print, index) => {
|
||||
otherData_.printObject?.prints?.forEach((print, index) => {// 印花
|
||||
print.name = t("Canvas.Print") + (index + 1);
|
||||
if(print.ifSingle){
|
||||
printTrimsLayers.unshift({...print});
|
||||
@@ -1466,7 +1466,7 @@ export class CanvasManager {
|
||||
singleLayers.unshift({...print});
|
||||
}
|
||||
})
|
||||
otherData_.trims?.prints?.forEach((trims, index) => {
|
||||
otherData_.trims?.prints?.forEach((trims, index) => {// 元素
|
||||
trims.name = t("Canvas.Elements") + (index + 1);
|
||||
printTrimsLayers.unshift({...trims});
|
||||
})
|
||||
@@ -1575,6 +1575,8 @@ export class CanvasManager {
|
||||
let item = printTrimsLayers[index];
|
||||
let id = generateId("layer_image_");
|
||||
let name = item.name;
|
||||
let blendMode = BlendMode.MULTIPLY;
|
||||
if(item.level2Type === "Embroidery") blendMode = BlendMode.NORMAL;// 元素正常
|
||||
let image = await new Promise(resolve => {
|
||||
fabric.Image.fromURL(item.path, (fabricImage)=>{
|
||||
const left = flLeft - flWidth * flScaleX / 2 + (item.location?.[0] || 0) * flScaleX
|
||||
@@ -1603,7 +1605,7 @@ export class CanvasManager {
|
||||
hasControls: true,
|
||||
hasBorders: true,
|
||||
isPrintTrims: true,
|
||||
globalCompositeOperation: BlendMode.MULTIPLY,
|
||||
globalCompositeOperation: blendMode,
|
||||
});
|
||||
resolve(fabricImage);
|
||||
}, { crossOrigin: "anonymous" });
|
||||
@@ -1617,7 +1619,7 @@ export class CanvasManager {
|
||||
locked: false,
|
||||
opacity: 1.0,
|
||||
isPrintTrims: true,
|
||||
blendMode: BlendMode.MULTIPLY,
|
||||
blendMode: blendMode,
|
||||
fabricObjects: [image.toObject(["id", "layerId", "layerName"])],
|
||||
metadata: {sourceData: item},
|
||||
})
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
<div class="content-bottom" ref="canvasContent">
|
||||
<div class="contet">
|
||||
<div class="canvas" :class="{'active': currentView === 'canvasEditor'}"@click.stop>
|
||||
<!-- :clothingMinIOPath="selectDetail.minIOPath" 部件选取 -->
|
||||
<editCanvas v-if="canvasLoad" :config="canvasConfig"
|
||||
@canvasInit="editSketchCanvasInit"
|
||||
is-edit
|
||||
:clothingMinIOPath="selectDetail.minIOPath"
|
||||
:clothingImageUrl="selectDetail.path"
|
||||
:clothingImageUrl2="selectDetail.layersObject[0].maskUrl"
|
||||
showFixedLayer
|
||||
|
||||
Reference in New Issue
Block a user