fix: 缩放时调整小车偏移的像素

This commit is contained in:
徐旦 2025-06-29 17:13:18 +08:00
parent 6cf714d1e5
commit 2bae00323c
3 changed files with 9 additions and 4 deletions

View File

@ -134,7 +134,7 @@ export const EDITOR_CONFIG: Options = {
/** 禁用重复线条 - 不允许在同一对点之间创建多条线 */
disableRepeatLine: true,
/** 最小缩放比例 - 画布最小缩放到1% */
minScale: 0.01,
minScale: 0.10,
/** 最大缩放比例 - 画布最大缩放到401% */
maxScale: 4.01,
/** 缩放步长 - 每次滚轮滚动的缩放幅度5% */

View File

@ -497,7 +497,12 @@ export class EditorService extends Meta2d {
const theme = this.data().theme;
const image =
import.meta.env.BASE_URL + (active ? `/robot/${type}-active-${theme}.png` : `/robot/${type}-${theme}.png`);
return { image, iconWidth: 34, iconHeight: 54, iconTop: -5 };
// 根据当前缩放比例调整iconTop避免15%等特定缩放下的像素对齐问题(小车和光圈没重合的问题)
const scale = this.store.data.scale || 1;
const iconTop = Math.round(-5 * scale) / scale;
return { image, iconWidth: 34, iconHeight: 54, iconTop };
}
//#endregion

View File

@ -8,8 +8,8 @@ param(
)
# 远程仓库配置常量
$UPSTREAM_URL = "http://192.168.189.2:8418/amr.core/web-amr"
$ORIGIN_URL = "http://192.168.189.2:8418/xudan/web-map"
$UPSTREAM_URL = "http://82.156.39.91:8418/amr.core/web-amr"
$ORIGIN_URL = "http://82.156.39.91:8418/xudan/web-map"
# 设置控制台编码以正确显示中文
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8