Commit dd04c715 by 李萌萌

漂移问题处理

parent a0a56ff1
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-10-22 11:36:10 * @Date: 2021-10-22 11:36:10
* @LastEditTime: 2021-12-11 14:17:27 * @LastEditTime: 2021-12-11 18:43:35
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue * @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue
...@@ -587,8 +587,6 @@ export default { ...@@ -587,8 +587,6 @@ export default {
isHandTZD: false, isHandTZD: false,
// 是否开始了拖拽 // 是否开始了拖拽
startHand: false, startHand: false,
originleft: null,
origintop: null,
// 角度 // 角度
angle: 0, angle: 0,
// 是否按下了空格 // 是否按下了空格
...@@ -998,8 +996,6 @@ export default { ...@@ -998,8 +996,6 @@ export default {
self.resetTzdDrawing() self.resetTzdDrawing()
}, 200); }, 200);
//重置位置变量 //重置位置变量
self.move_left = 0;
self.move_top = 0;
self.zoomLevel = 1; self.zoomLevel = 1;
imageEditor.resetFlip().then(function (status) { imageEditor.resetFlip().then(function (status) {
...@@ -1298,8 +1294,8 @@ export default { ...@@ -1298,8 +1294,8 @@ export default {
originPointer = { originPointer = {
x: e.clientX, x: e.clientX,
y: e.clientY, y: e.clientY,
left: self.imageEditor._graphics.getCanvasImage().left, left:self.imageEditor._graphics.getCanvasImage().left,
top: self.imageEditor._graphics.getCanvasImage().top, top:self.imageEditor._graphics.getCanvasImage().top
}; };
// 开启拖拽 // 开启拖拽
if (self.isHand || self.isHandSpace) { if (self.isHand || self.isHandSpace) {
...@@ -1501,18 +1497,17 @@ export default { ...@@ -1501,18 +1497,17 @@ export default {
let x2 = e.clientX; let x2 = e.clientX;
let y2 = e.clientY; let y2 = e.clientY;
let canvasImage = imageEditor._graphics.getCanvasImage() let canvasImage = imageEditor._graphics.getCanvasImage()
let originleft = self.originleft || 0;
let origintop = self.origintop || 0;
// 移动图片 // 移动图片
const offsetx = canvasImage.getCenterPoint().x - 320; const offsetx = canvasImage.getCenterPoint().x - 320;
const offsety = canvasImage.getCenterPoint().y - 320; const offsety = canvasImage.getCenterPoint().y - 320;
const leftNew = const leftNew =
originleft + originPointer.left +
((x2 - x1) * self.newWidth) / self.canvasWidth / self.zoomLevel; ((x2 - x1) * self.newWidth) / self.canvasWidth / self.zoomLevel;
const topNew = const topNew =
origintop + originPointer.top +
((y2 - y1) * self.newHeight) / self.canvasHeight / self.zoomLevel; ((y2 - y1) * self.newHeight) / self.canvasHeight / self.zoomLevel;
console.log("当前移动:",x2 - x1,y2 - y1)
imageEditor._graphics.setImageProperties( imageEditor._graphics.setImageProperties(
{ {
left: leftNew, left: leftNew,
...@@ -1527,12 +1522,7 @@ export default { ...@@ -1527,12 +1522,7 @@ export default {
self.tzdDrawing_top = Number(self.tzdDrawingTop_yd) + (y2 - y1); self.tzdDrawing_top = Number(self.tzdDrawingTop_yd) + (y2 - y1);
self.tzdDrawing_left = Number(self.tzdDrawingLeft_yd) + (x2 - x1); self.tzdDrawing_left = Number(self.tzdDrawingLeft_yd) + (x2 - x1);
self.move_left =
originleft +
((x2 - x1) * self.newWidth) / self.canvasWidth / self.zoomLevel;
self.move_top =
origintop +
((y2 - y1) * self.newHeight) / self.canvasHeight / self.zoomLevel;
} }
if (self.mouseEnlarge) { if (self.mouseEnlarge) {
// 放大 // 放大
...@@ -1643,8 +1633,6 @@ export default { ...@@ -1643,8 +1633,6 @@ export default {
.querySelector(".tzdDrawing") .querySelector(".tzdDrawing")
.addEventListener("mouseup", function (e) { .addEventListener("mouseup", function (e) {
let canvasImage = imageEditor._graphics.getCanvasImage(); let canvasImage = imageEditor._graphics.getCanvasImage();
self.originleft = canvasImage.left;
self.origintop = canvasImage.top;
self.tzdDrawingLeft = canvasImage.left; self.tzdDrawingLeft = canvasImage.left;
self.tzdDrawingTop = canvasImage.top; self.tzdDrawingTop = canvasImage.top;
...@@ -2339,8 +2327,6 @@ export default { ...@@ -2339,8 +2327,6 @@ export default {
self.resetTzdDrawing(true); self.resetTzdDrawing(true);
}, 200); }, 200);
//重置位置变量 //重置位置变量
self.move_left = 0;
self.move_top = 0;
self.tzdDrawing_left = 0; self.tzdDrawing_left = 0;
self.tzdDrawing_top = 0; self.tzdDrawing_top = 0;
self.zoomLevel = 1; self.zoomLevel = 1;
...@@ -3653,7 +3639,7 @@ export default { ...@@ -3653,7 +3639,7 @@ export default {
}, },
true true
); );
self.changeTzdDrawing(true); self.changeTzdDrawing(true,true);
// LMM↑↑↑↑↑↑↑↑↑↑↑↑ // LMM↑↑↑↑↑↑↑↑↑↑↑↑
}; };
...@@ -3811,7 +3797,6 @@ export default { ...@@ -3811,7 +3797,6 @@ export default {
// 是否点击了历史 // 是否点击了历史
this.isActive_history = false; this.isActive_history = false;
//console.log(this.imageEditor); //console.log(this.imageEditor);
this.imageEditor.stopDrawingMode(); this.imageEditor.stopDrawingMode();
this.isHand = !this.isHand; this.isHand = !this.isHand;
if (this.isHand) { if (this.isHand) {
...@@ -4055,7 +4040,7 @@ export default { ...@@ -4055,7 +4040,7 @@ export default {
/** /**
* 对特征点图层进行更新 * 对特征点图层进行更新
*/ */
changeTzdDrawing (isPingyi) { changeTzdDrawing (isPingyi,isNotRefreshSourcePrivew) {
let canvasImage = this.imageEditor._graphics.getCanvasImage(); let canvasImage = this.imageEditor._graphics.getCanvasImage();
// 当前图像中心点 // 当前图像中心点
var centerP = canvasImage.getCenterPoint(); var centerP = canvasImage.getCenterPoint();
...@@ -4087,6 +4072,7 @@ export default { ...@@ -4087,6 +4072,7 @@ export default {
); );
// 缩略图 // 缩略图
if (this.isShowSourcePrivew) { if (this.isShowSourcePrivew) {
// if (this.isShowSourcePrivew&&!isNotRefreshSourcePrivew) {
// 底图变换 // 底图变换
$("#preview-source-img").css( $("#preview-source-img").css(
"transform", "transform",
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-09-07 09:57:48 * @Date: 2021-09-07 09:57:48
* @LastEditTime: 2021-12-11 14:23:25 * @LastEditTime: 2021-12-11 18:05:11
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\vue.config.js * @FilePath: \指纹系统\founder_vue\vue.config.js
...@@ -111,7 +111,7 @@ module.exports = { ...@@ -111,7 +111,7 @@ module.exports = {
"/login": { "/login": {
// target: "http://www.meetfood.cn:2390/", // 登录 // target: "http://www.meetfood.cn:2390/", // 登录
target: "http://zwpt.xzclub.top:9333", target: "http://zwpt.xzclub.top:9333",
// target: "http://192.168.128.124:8764/", // 登录 // target: "http://192.168.128.124:8765/", // 登录
// target: "http://192.168.128.114:8099", // 登录-马 // target: "http://192.168.128.114:8099", // 登录-马
ws: true, ws: true,
changeOrigin: true, changeOrigin: true,
...@@ -132,8 +132,8 @@ module.exports = { ...@@ -132,8 +132,8 @@ module.exports = {
"/security": { "/security": {
//target: "http://192.168.128.106:8765", // 湖南-王 //target: "http://192.168.128.106:8765", // 湖南-王
// target: "http://192.168.128.124:8764", // 湖南-张 target: "http://192.168.128.124:8765", // 湖南-张
target:"http://zwpt.xzclub.top:9333/", // target:"http://zwpt.xzclub.top:9333/",
// target: "http://www.meetfood.cn:2390", // 湖南-王 // target: "http://www.meetfood.cn:2390", // 湖南-王
ws: true, ws: true,
......
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