Commit 53d6a0b3 authored by xinzhedeai's avatar xinzhedeai

add:guan 动态test 数量4

parent 76936d94
......@@ -183,15 +183,22 @@ export default {
// 数据清洗
const canvasH = 600
const canvasW = 1000
const po_pad_right = 180 // 第一个台阶距离画布的距离
const poH = 150
this.poConfigs = []
this.guanConfigs = []
for (let index = 0; index < 4; index++) {
this.poConfigs.push({
x: 0, y: canvasH-((index+1)*150), width: 879 - (index*250), height: 150
x: 0,
y: canvasH-((index+1)*poH),
width: canvasW - ((index+1)*po_pad_right),
height: 150
})
// this.guanConfigs.push({
// x: null, y: null, width: 6, height: index==0?121:200, image: 'guanImage'
// })
this.guanConfigs.push({
x: this.poConfigs[index].width *0.75, y: canvasH - (this.poConfigs[index].height*(index+1)) + 30, width: 6, height: index==0?100:200, image: 'guanImage'
})
}
// lineConfigs: [
......@@ -340,19 +347,20 @@ export default {
});
// 3. 绘制guan.png(遍历配置数组)
console.log(this.guanConfigs, 'guanConfigs')
this.guanConfigs.forEach((config, index) => {
const firstPo = this.poConfigs[0];
const secondPo = this.poConfigs[1];
// 第一张guan.png坐标计算(基于第一张po.png)
if (index === 0) {
config.x = firstPo.width - 150; // 879 - 150
config.y = canvasHeight - 135.5; // 原计算逻辑
}
// 第二张guan.png坐标计算(基于第二张po.png)
if (index === 1) {
config.x = secondPo.width - 150; // secondPoWidth - 150
config.y = secondPo.y + 30; // secondPoY + 30
}
// const firstPo = this.poConfigs[0];
// const secondPo = this.poConfigs[1];
// // 第一张guan.png坐标计算(基于第一张po.png)
// if (index === 0) {
// config.x = firstPo.width - 150; // 879 - 150
// config.y = canvasHeight - 135.5; // 原计算逻辑
// }
// // 第二张guan.png坐标计算(基于第二张po.png)
// if (index === 1) {
// config.x = secondPo.width - 150; // secondPoWidth - 150
// config.y = secondPo.y + 30; // secondPoY + 30
// }
this.drawGuanImage(config);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment