hookehuyr

fix 旋转后的图片位置会有偏移,需要调整

<!--
* @Date: 2025-01-22 11:40:12
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-04 15:13:41
* @LastEditTime: 2025-03-04 16:07:51
* @FilePath: /map-demo/src/views/mapCutter.vue
* @Description: 文件描述
-->
......@@ -110,8 +110,8 @@
<!-- 旋转控制 -->
<div class="rotate-control">
<button class="z-button" @click="rotateMap(1)"></button>
<button class="z-button" @click="rotateMap(-1)"></button>
<button class="z-button" @click="rotateMap(1)"></button>
<button class="z-button" @click="rotateMap(-1)"></button>
</div>
<!-- 透明度控制 -->
......@@ -416,7 +416,7 @@ const rotateMap = (deltaAngle) => {
if (!imageLayer.value || !imageURL.value) return;
imageRotation.value = (imageRotation.value + deltaAngle) % 360;
console.log(`图片旋转: ${imageRotation.value}°`);
// console.log(`图片旋转: ${imageRotation.value}°`);
const img = new Image();
img.src = imageURL.value;
......@@ -495,6 +495,8 @@ const rotateMap = (deltaAngle) => {
});
map.value.add(imageLayer.value);
// FIXME: 旋转后的图片位置会有偏移,需要调整
moveImage('down')
};
};
......