修复印花overall偏移和画布对不上问题

This commit is contained in:
X1627315083
2026-01-21 09:59:17 +08:00
parent a1e0e19412
commit 62e977c703
3 changed files with 11 additions and 8 deletions

View File

@@ -603,8 +603,11 @@ export default defineComponent({
// detailDom.canvasBox.editFront(str) // detailDom.canvasBox.editFront(str)
// } // }
detailDom.canvasBox.editFront(str) detailDom.canvasBox.editFront(str)
let otherData = await updateOtherLayers('single') if(str == 'canvasEditor'){
await detailDom.canvasBox.updateOtherLayers(otherData) let otherData = await updateOtherLayers('single')
console.log(otherData,'============')
await detailDom.canvasBox.updateOtherLayers(otherData)
}
detailData.isEditPattern.value = str detailData.isEditPattern.value = str
} }
}else{ }else{

View File

@@ -252,7 +252,7 @@ export default defineComponent({
designType:data.designType, designType:data.designType,
ifSingle:editPrintElementData.stateOverallSingle == 'single', ifSingle:editPrintElementData.stateOverallSingle == 'single',
level2Type:data.level2Type, level2Type:data.level2Type,
location, location:editPrintElementData.stateOverallSingle == 'single'?location:[0,0],
minIOPath:data.minIOPath || data.originalUrl, minIOPath:data.minIOPath || data.originalUrl,
path:data.url, path:data.url,
priority:editPrintElementData.printZIndex, priority:editPrintElementData.printZIndex,
@@ -276,7 +276,8 @@ export default defineComponent({
}else{ }else{
let x = Number(style.left.replace(/px/g,'')) let x = Number(style.left.replace(/px/g,''))
let y = Number(style.top.replace(/px/g,'')) let y = Number(style.top.replace(/px/g,''))
location = [(x*sketchWH[0]) ,(y*sketchWH[1])] location = item.location
// location = [(x*sketchWH[0]) ,(y*sketchWH[1])]
scale = item.scale scale = item.scale
// scale = [item.pattern.style.width/item.pattern.style.height,item.pattern.style.height/item.pattern.style.width] // scale = [item.pattern.style.width/item.pattern.style.height,item.pattern.style.height/item.pattern.style.width]
// location = [item.pattern.style.left,item.pattern.style.top] // location = [item.pattern.style.left,item.pattern.style.top]
@@ -901,7 +902,6 @@ export default defineComponent({
const inputFillOffset = (offset:any)=>{ const inputFillOffset = (offset:any)=>{
let arr = editPrintElementData.printStyleList[props.type].overall let arr = editPrintElementData.printStyleList[props.type].overall
arr[editPrintElementData.imgDomIndex].location = [offset.left * offset.size[0] / 100,offset.top * offset.size[1] / 100] arr[editPrintElementData.imgDomIndex].location = [offset.left * offset.size[0] / 100,offset.top * offset.size[1] / 100]
console.log(arr[editPrintElementData.imgDomIndex].location)
editPrintElementDom.pingpuRef.updataList([ editPrintElementDom.pingpuRef.updataList([
{ {
action: ACTIONS.UPDATE, action: ACTIONS.UPDATE,

View File

@@ -17,7 +17,7 @@
:max="1000" :max="1000"
:step="1" :step="1"
is-input is-input
:tipFormatter="(v) => `${scale}%`" :tipFormatter="(v) => `${scale.toFixed(0)}%`"
:value="scale" :value="scale"
@input="inputFillScale" @input="inputFillScale"
/> />
@@ -121,8 +121,8 @@
]); ]);
const inputFillScale = (e) => { const inputFillScale = (e) => {
const scale = e / 100; const scale = e / 100;
console.log(scale) console.log(scale.toFixed(2))
emit("inputFillScale", scale); emit("inputFillScale", scale.toFixed(2));
}; };
const inputOffset = async (e:any)=>{ const inputOffset = async (e:any)=>{
emit('inputFillOffset', {...e,size: await sketchSize()}) emit('inputFillOffset', {...e,size: await sketchSize()})