Commit d03d6f6b by 张超军

旋转后平移

parent df9a82fb
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-10-22 11:36:10 * @Date: 2021-10-22 11:36:10
* @LastEditTime: 2021-11-13 15:01:29 * @LastEditTime: 2021-11-13 16:29:53
* @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
...@@ -1035,7 +1035,7 @@ export default { ...@@ -1035,7 +1035,7 @@ export default {
imageEditor.rotate(30); imageEditor.rotate(30);
self.historys.push('旋转') self.historys.push('旋转')
let canvasImage = imageEditor._graphics.getCanvasImage() let canvasImage = imageEditor._graphics.getCanvasImage()
$('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`); $('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg) scale(${self.zoomLevel})`);
// 每次旋转时,位置都会改变,需要重新定位 // 每次旋转时,位置都会改变,需要重新定位
if (self.move_left && self.move_top) { if (self.move_left && self.move_top) {
...@@ -1054,7 +1054,7 @@ export default { ...@@ -1054,7 +1054,7 @@ export default {
self.isRightRotate = true self.isRightRotate = true
imageEditor.rotate(-30); imageEditor.rotate(-30);
let canvasImage = imageEditor._graphics.getCanvasImage() let canvasImage = imageEditor._graphics.getCanvasImage()
$('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`) $('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg) scale(${self.zoomLevel})`)
self.historys.push('旋转') self.historys.push('旋转')
// 每次旋转时,位置都会改变,需要重新定位 // 每次旋转时,位置都会改变,需要重新定位
...@@ -1075,7 +1075,7 @@ export default { ...@@ -1075,7 +1075,7 @@ export default {
self.startPlace = self.inputRotationRange; self.startPlace = self.inputRotationRange;
// 特征点的图层也要跟着转 // 特征点的图层也要跟着转
$('.tzdDrawing').css("transform", `rotate(${self.inputRotationRange}deg)`) $('.tzdDrawing').css("transform", `rotate(${self.inputRotationRange}deg) scale(${self.zoomLevel})`)
}; };
$(document).on('mousemove', changeAngle); $(document).on('mousemove', changeAngle);
...@@ -1091,7 +1091,7 @@ export default { ...@@ -1091,7 +1091,7 @@ export default {
self.startPlace = self.inputRotationRange; self.startPlace = self.inputRotationRange;
self.historys.push('旋转') self.historys.push('旋转')
// 特征点的图层也要跟着转 // 特征点的图层也要跟着转
$('.tzdDrawing').css("transform", `rotate(${self.inputRotationRange}deg)`) $('.tzdDrawing').css("transform", `rotate(${self.inputRotationRange}deg) scale(${self.zoomLevel})`)
}); });
// 划线事件 // 划线事件
...@@ -1502,11 +1502,13 @@ export default { ...@@ -1502,11 +1502,13 @@ export default {
}, true) }, true)
// console.log(imageEditor._graphics.getImageProperties()); // console.log(imageEditor._graphics.getImageProperties());
// console.log(imageEditor._graphics.getCanvasImage()); // console.log(imageEditor._graphics.getCanvasImage());
let canvasImage = imageEditor._graphics.getCanvasImage()
// $('.tzdDrawing').css('left', `${originleft + (x2 - x1)}px`) // $('.tzdDrawing').css('left', `${originleft + (x2 - x1)}px`)
// $('.tzdDrawing').css('top', `${origintop + (y2 - y1)}px`) // $('.tzdDrawing').css('top', `${origintop + (y2 - y1)}px`)
// $('.tzdDrawing').css('transform', `translate(${x2 - x1}px,${y2 - y1}px)`) // $('.tzdDrawing').css('transform', `translate(${x2 - x1}px,${y2 - y1}px)`)
// TODO
$('.tzdDrawing').css('transform', `translate(${Number(self.tzdDrawingLeft) + (x2 - x1)}px,${Number(self.tzdDrawingTop) + (y2 - y1)}px) scale(${self.zoomLevel})`) $('.tzdDrawing').css('transform', `translate(${Number(self.tzdDrawingLeft) + (x2 - x1)}px,${Number(self.tzdDrawingTop) + (y2 - y1)}px) scale(${self.zoomLevel})`)
$('.tzdDrawing_2').css('transform', `translate(${Number(self.tzdDrawingLeft) + (x2 - x1)}px,${Number(self.tzdDrawingTop) + (y2 - y1)}px) scale(${self.zoomLevel})`) $('.tzdDrawing_2').css('transform', `translate(${Number(self.tzdDrawingLeft) + (x2 - x1)}px,${Number(self.tzdDrawingTop) + (y2 - y1)}px) scale(${self.zoomLevel})`)
...@@ -3507,9 +3509,7 @@ export default { ...@@ -3507,9 +3509,7 @@ export default {
this.imageEditor.rotate(deg) this.imageEditor.rotate(deg)
let canvasImage = this.imageEditor._graphics.getCanvasImage() let canvasImage = this.imageEditor._graphics.getCanvasImage()
this.startPlace = newValue; this.startPlace = newValue;
$('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`) $('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg) scale(${self.zoomLevel})`)
// 特征点的图层也要跟着转
$('.tzdDrawing').css("transform", `rotate(${newValue}deg)`)
}, },
inputRemoveWhiteRange (newValue, oldValue) { inputRemoveWhiteRange (newValue, oldValue) {
this.imageEditor.applyFilter('removeColor', { this.imageEditor.applyFilter('removeColor', {
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-09-07 09:57:48 * @Date: 2021-09-07 09:57:48
* @LastEditTime: 2021-11-13 11:09:56 * @LastEditTime: 2021-11-13 15:40:37
* @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
......
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