This commit is contained in:
fan 2020-05-11 16:55:06 +08:00
commit ca5b78784e
3 changed files with 8 additions and 12 deletions

View File

@ -173,10 +173,10 @@ class Jlmap {
}
}
}
// const scaleWidth = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
// const scaleHeight = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
// const scale = Math.min(scaleWidth, scaleHeight);
const scaleWidth = Math.floor((((opts.width - 200) * num) / rect.width) * 100) / 100;
const scaleHeight = Math.floor(((opts.height - 100) / (rect.height * num)) * 100) / 100;
const scale = Math.min(scaleWidth, scaleHeight);
// const scale = 0.3;
// const spliceWidth = (rect.width + 100) / num * scale;
// const dx = (opts.width - spliceWidth) / 2;
@ -186,20 +186,19 @@ class Jlmap {
// }
const splitList = Vue.prototype.$theme.loadPropConvert(store.state.map.map.skinVO.code).screenSplit;
const scale = 0.3;
const maxWidth = rect.width + 30;
const maxWidth = rect.width;
splitList.push(maxWidth);
for (let i = 0; i < splitList.length; i++) {
let offsetX = '';
if (i == 0) {
offsetX = -(opts.width - splitList[i] * scale) / 2;
offsetX = -(opts.width - splitList[0] * scale) / 2;
} else {
const dx = (opts.width - (splitList[i] - splitList[i - 1]) * scale) / 2; // 居中计算偏移值
offsetX = splitList[i - 1] * scale - dx;
}
const param = { scaleRate: scale, offsetX: offsetX, offsetY: -100 - (offsetY * i) };
arr.push(param);
const rect = {x: 0, y: 0, width: Number(splitList[i]) + 10, height: opts.height};
const rect = {x: 0, y: 0, width: Number(splitList[i]), height: opts.height};
rectList.push(rect);
}
this.$painter.updateTransform1(arr, rectList);

View File

@ -3,7 +3,7 @@ import deviceType from '../../constant/deviceType';
class Model {
constructor() {
this.screenLine = 3;
this.screenSplit = ['5165', '10303'];
this.screenSplit = ['5165', '10299'];
// 公共字段部分默认初始值
this['public'] = {};
this['public'][deviceType.Signal] = {

View File

@ -34,8 +34,6 @@ class TransformHandle {
}
view.show(); return;
}
// console.log(view, rect);
// if (this.checkVisible(view, rect)) { view.show(); return; } else { view.hide(); }
}
view.dirty(); // 更新
}
@ -59,7 +57,6 @@ class TransformHandle {
list.forEach(item => {
this.transform.push(createTransform(item));
});
console.log(this.transform, this.rectList, '------');
this.transformAll();
}