Commit ccd7ea4a by 李君

小数点

1 parent 6e813baf
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
if (_width >= _xy) { if (_width >= _xy) {
width = _xy width = _xy
height = parseInt(_xy * _height / _width) height = parseInt(_xy * _height / _width)
this.radix = (_width / _xy).toFixed(2) this.radix = (_width / _xy).toFixed(0)
} else if (_width < _xy) { } else if (_width < _xy) {
width = _width * this.scaleVal width = _width * this.scaleVal
height = _height * this.scaleVal height = _height * this.scaleVal
...@@ -186,8 +186,8 @@ ...@@ -186,8 +186,8 @@
if (status === 'floor') { if (status === 'floor') {
coordinate.mapPoints.forEach(item => { coordinate.mapPoints.forEach(item => {
gateVal.push([ gateVal.push([
(item.x / this.normalWidth * width).toFixed(2), (item.x / this.normalWidth * width).toFixed(0),
(item.y / this.normalWidth * height).toFixed(2) (item.y / this.normalWidth * height).toFixed(0)
]) ])
}) })
this.editGateXY.val = gateVal this.editGateXY.val = gateVal
...@@ -277,13 +277,13 @@ ...@@ -277,13 +277,13 @@
let height = this.getStyleFn(id, 'height'); let height = this.getStyleFn(id, 'height');
let ev = e || window.event; let ev = e || window.event;
let eleRect = ev.target.getBoundingClientRect(); let eleRect = ev.target.getBoundingClientRect();
let _top = (eleRect.top - ev.target.clientTop).toFixed(2); let _top = (eleRect.top - ev.target.clientTop).toFixed(0);
let _left = (eleRect.left - ev.target.clientLeft).toFixed(2); let _left = (eleRect.left - ev.target.clientLeft).toFixed(0);
let startX = ev.pageX - _left - $(document).scrollLeft(); let startX = ev.pageX - _left - $(document).scrollLeft();
let startY = ev.pageY - _top - $(document).scrollTop(); let startY = ev.pageY - _top - $(document).scrollTop();
let xVal = (startX * this.normalWidth / width).toFixed(2); let xVal = (startX * this.normalWidth / width).toFixed(0);
let yVal = (startY * this.normalHeight / height).toFixed(2); let yVal = (startY * this.normalHeight / height).toFixed(0);
let canvas = document.getElementById(canvasId); let canvas = document.getElementById(canvasId);
if (!canvas.getContext) return; if (!canvas.getContext) return;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!