印花和元素不等比缩放调整
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
<img src="../../assets/images/homePage/cuowu.svg" alt="">
|
||||
</li>
|
||||
</ul>
|
||||
<div></div>
|
||||
<!-- <div></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -261,7 +261,7 @@ export default defineComponent({
|
||||
if(this.$parent.exhibitionList.elements)this.designSelectElementsList = JSON.parse(JSON.stringify(this.$parent.exhibitionList.elements))
|
||||
if(this.$parent.elementsList)this.designElementsList = JSON.parse(JSON.stringify(this.$parent.elementsList))
|
||||
let skecth = new Image
|
||||
skecth.src = this.current.path
|
||||
skecth.src = this.current.undividedLayer || this.current.path
|
||||
skecth.onload=()=>{
|
||||
this.sketch.width = skecth.width/10+'rem'
|
||||
this.sketch.height = skecth.height/10+'rem'
|
||||
@@ -408,7 +408,7 @@ export default defineComponent({
|
||||
w = (e.clientX - this.printStyleList[this.imgDomIndex].centers.left)
|
||||
h = (e.clientX - this.printStyleList[this.imgDomIndex].centers.left)*num
|
||||
width = w+'px'
|
||||
height = w*num1+'px'
|
||||
// height = w*num1+'px'
|
||||
}else if(this.direction == 'top'){
|
||||
this.printStyleList[this.imgDomIndex].style.top = 'auto'
|
||||
// this.printStyleList[this.imgDomIndex].style.left = 'auto'
|
||||
@@ -417,17 +417,17 @@ export default defineComponent({
|
||||
h = (this.printStyleList[this.imgDomIndex].centers.top - e.clientY)
|
||||
|
||||
height = h+'px'
|
||||
width = h*num+'px'
|
||||
// width = h*num+'px'
|
||||
}else if(this.direction == 'bottom'){
|
||||
h = (e.clientY - this.printStyleList[this.imgDomIndex].centers.top)
|
||||
height = h+'px'
|
||||
width = h*num+'px'
|
||||
// width = h*num+'px'
|
||||
}else if(this.direction == 'left'){
|
||||
this.printStyleList[this.imgDomIndex].style.left = 'auto'
|
||||
this.printStyleList[this.imgDomIndex].style.right = parentNode.offsetWidth -imgDomWH.width - this.imgDom.offsetLeft+'px'
|
||||
w = (this.printStyleList[this.imgDomIndex].centers.left - e.clientX)
|
||||
width = w+'px'
|
||||
height = w*num1+'px'
|
||||
// height = w*num1+'px'
|
||||
}
|
||||
//判断尺寸是否到边
|
||||
this.printStyleList[this.imgDomIndex].style.width = width
|
||||
@@ -526,8 +526,10 @@ export default defineComponent({
|
||||
top:top,
|
||||
right:"auto",
|
||||
bottom:"auto",
|
||||
width:this.print.width.replace(/px/g,'')/sketchNum*item.scale+'px',
|
||||
height:this.print.height.replace(/px/g,'')/sketchNum*item.scale+'px',
|
||||
// width:this.print.width.replace(/px/g,'')/sketchNum*item.scale+'px',
|
||||
// height:this.print.height.replace(/px/g,'')/sketchNum*item.scale+'px',
|
||||
width:sketch.offsetWidth*item.scale[0]+'px',
|
||||
height:sketch.offsetHeight*item.scale[1]+'px',
|
||||
zIndex:zIndex++
|
||||
},
|
||||
transform:{
|
||||
@@ -565,7 +567,7 @@ export default defineComponent({
|
||||
let location
|
||||
for (let index = 0; index < arr.length; index++) {
|
||||
await this.setPrintWH(this.exhibitionElementsList[index].path)
|
||||
scale = (arr[index].style.width.replace(/px/g,'')*sketchNum/this.print.width.replace(/px/g,''))
|
||||
scale = [arr[index].style.width.replace(/px/g,'')/sketch.offsetWidth,(arr[index].style.height.replace(/px/g,'')/sketch.offsetHeight)]
|
||||
location = [arr[index].style.left.replace(/px/g,'')*sketchNum,arr[index].style.top.replace(/px/g,'')*sketchNum]
|
||||
let obj = {
|
||||
angle : arr[index].transform.rotateZ,
|
||||
|
||||
@@ -353,7 +353,7 @@ export default defineComponent({
|
||||
this.sketch.height = skecth.height/10+'rem'
|
||||
skecth.remove()
|
||||
}
|
||||
skecth.src = this.current.path
|
||||
skecth.src = this.current.undividedLayer || this.current.path
|
||||
if(this.exhibitionOpenrtionList.overall.length > 0){
|
||||
let str = 'overall'
|
||||
this.exhibitionOpenrtionList[str].forEach((item,index)=>{
|
||||
@@ -581,7 +581,7 @@ export default defineComponent({
|
||||
w = (e.clientX - this.printStyleList[this.stateOverallSingle][this.imgDomIndex].centers.left)
|
||||
h = (e.clientX - this.printStyleList[this.stateOverallSingle][this.imgDomIndex].centers.left)*num
|
||||
width = w+'px'
|
||||
height = w*num1+'px'
|
||||
// height = w*num1+'px'
|
||||
}else if(this.direction == 'top'){
|
||||
this.printStyleList[this.stateOverallSingle][this.imgDomIndex].style.top = 'auto'
|
||||
// this.printStyleList[this.stateOverallSingle][this.imgDomIndex].style.left = 'auto'
|
||||
@@ -590,17 +590,17 @@ export default defineComponent({
|
||||
h = (this.printStyleList[this.stateOverallSingle][this.imgDomIndex].centers.top - e.clientY)
|
||||
|
||||
height = h+'px'
|
||||
width = h*num+'px'
|
||||
// width = h*num+'px'
|
||||
}else if(this.direction == 'bottom'){
|
||||
h = (e.clientY - this.printStyleList[this.stateOverallSingle][this.imgDomIndex].centers.top)
|
||||
height = h+'px'
|
||||
width = h*num+'px'
|
||||
// width = h*num+'px'
|
||||
}else if(this.direction == 'left'){
|
||||
this.printStyleList[this.stateOverallSingle][this.imgDomIndex].style.left = 'auto'
|
||||
this.printStyleList[this.stateOverallSingle][this.imgDomIndex].style.right = parentNode.offsetWidth -imgDomWH.width - this.imgDom.offsetLeft+'px'
|
||||
w = (this.printStyleList[this.stateOverallSingle][this.imgDomIndex].centers.left - e.clientX)
|
||||
width = w+'px'
|
||||
height = w*num1+'px'
|
||||
// height = w*num1+'px'
|
||||
}
|
||||
//判断尺寸是否到边
|
||||
this.printStyleList[this.stateOverallSingle][this.imgDomIndex].style.width = width
|
||||
@@ -728,8 +728,10 @@ export default defineComponent({
|
||||
top:top,
|
||||
right:"auto",
|
||||
bottom:"auto",
|
||||
width:this.print.width.replace(/px/g,'')/sketchNum*item.scale+'px',
|
||||
height:this.print.height.replace(/px/g,'')/sketchNum*item.scale+'px',
|
||||
// width:this.print.width.replace(/px/g,'')/sketchNum*item.scale[0]+'px',
|
||||
// height:this.print.height.replace(/px/g,'')/sketchNum*item.scale[1]+'px',
|
||||
width:sketch.offsetWidth*item.scale[0]+'px',
|
||||
height:sketch.offsetHeight*item.scale[1]+'px',
|
||||
zIndex:zIndex++
|
||||
},
|
||||
transform:{
|
||||
@@ -800,20 +802,20 @@ export default defineComponent({
|
||||
let location
|
||||
for (let index = 0; index < arr.length; index++) {
|
||||
if(!this.overallSingle){
|
||||
scale = this.systemDesignerPercentage/100
|
||||
scale =[ this.systemDesignerPercentage/100, this.systemDesignerPercentage/100]
|
||||
let overallScale = (arr[index].style.width.replace(/px/g,'')*sketchNum/this.print.width.replace(/px/g,''))
|
||||
let x = Number(arr[index].style.left.replace(/px/g,''))
|
||||
let y = Number(arr[index].style.top.replace(/px/g,''))
|
||||
// let x = (Number(arr[index].style.left.replace(/px/g,'')) + Number(arr[index].style.width.replace(/px/g,''))/2)*sketchNum
|
||||
// let y = (Number(arr[index].style.top.replace(/px/g,'')) + Number(arr[index].style.height.replace(/px/g,''))/2)*sketchNum
|
||||
let width = Number(this.print.width.replace(/px/g,''))*scale/5/2
|
||||
let height = Number(this.print.height.replace(/px/g,''))*scale/5/2
|
||||
|
||||
let width = Number(this.print.width.replace(/px/g,''))*scale[0]/5/2
|
||||
let height = Number(this.print.height.replace(/px/g,''))*scale[0]/5/2
|
||||
// location = [(x*sketchNum) ,(y*sketchNum)]
|
||||
location = [(x*sketchNum) - width/sketchNum/2 ,(y*sketchNum) - height/sketchNum/2]
|
||||
}else{
|
||||
await this.setPrintWH(this.exhibitionOpenrtionList[this.stateOverallSingle][index].path)
|
||||
scale = (arr[index].style.width.replace(/px/g,'')*sketchNum/this.print.width.replace(/px/g,''))
|
||||
console.log(arr[index].style.width.replace(/px/g,''),sketch.offsetWidth,arr[index].style.height.replace(/px/g,''),sketch.offsetHeight);
|
||||
scale = [arr[index].style.width.replace(/px/g,'')/sketch.offsetWidth,(arr[index].style.height.replace(/px/g,'')/sketch.offsetHeight)]
|
||||
location = [arr[index].style.left.replace(/px/g,'')*sketchNum,arr[index].style.top.replace(/px/g,'')*sketchNum]
|
||||
}
|
||||
let obj = {
|
||||
|
||||
@@ -515,6 +515,7 @@ export default defineComponent({
|
||||
for (let index = 0; index < rv.clothes.length; index++) {
|
||||
if(rv.clothes[index].id === item.id && !rv.clothes[index].similarity){
|
||||
item.layersObject = rv.clothes[index].layersObject
|
||||
item.undividedLayer = rv.clothes[index].undividedLayer
|
||||
item.priority = rv.clothes[index].layersObject[0].priority
|
||||
rv.clothes[index].similarity = true
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user