Commit 2c19445a by liyuhang19990520

旋转bug

parent 92f43cf7
<!--
* @Author: your name
* @Date: 2021-10-22 11:36:10
* @LastEditTime: 2021-11-06 15:12:14
* @LastEditTime: 2021-11-08 20:47:21
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue
......@@ -1011,6 +1011,17 @@ export default {
self.historys.push('旋转')
let canvasImage = imageEditor._graphics.getCanvasImage()
$('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`);
// 每次旋转时,位置都会改变,需要重新定位
if (self.move_left && self.move_top) {
imageEditor._graphics.setImageProperties({
left: self.move_left + canvasImage.left,
top: self.move_top + canvasImage.top,
originX: 'left',
originY: 'top'
}, true)
}
});
// 向右旋转30°
$btnRotateCounterClockWise.on('click', function () {
......@@ -1021,6 +1032,17 @@ export default {
let canvasImage = imageEditor._graphics.getCanvasImage()
$('.tzdDrawing').css('transform', `rotate(${canvasImage.angle}deg)`)
self.historys.push('旋转')
// 每次旋转时,位置都会改变,需要重新定位
if (self.move_left && self.move_top) {
imageEditor._graphics.setImageProperties({
left: self.move_left + canvasImage.left,
top: self.move_top + canvasImage.top,
originX: 'left',
originY: 'top'
}, true)
}
});
// 滑动旋转事件
$inputRotationRange.on('mousedown', function () {
......
<!--
* @Author: your name
* @Date: 2021-10-22 11:36:10
* @LastEditTime: 2021-11-08 20:41:53
* @LastEditTime: 2021-11-08 20:51:07
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\src\views\Editor\modules\imageEd.vue
......@@ -1412,12 +1412,12 @@ export default {
}
// console.log(self.mouseEnlarge);
if (self.mouseEnlarge) {
imageEditor._graphics.setImageProperties({
left: 0,
top: 0,
originX: 'left',
originY: 'top'
}, true)
// imageEditor._graphics.setImageProperties({
// left: 0,
// top: 0,
// originX: 'left',
// originY: 'top'
// }, true)
// 放大
if (e.clientY <= originPointer.y) {
self.zoomLevel = self.zoomLevel + 0.01
......
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