feat: 调整画布最小缩放比例至0.04,并更新机器人图标尺寸以改善视觉效果

This commit is contained in:
xudan 2025-08-15 11:20:04 +08:00
parent 5727beb7bb
commit 4cbc6d1897
2 changed files with 6 additions and 6 deletions

View File

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

View File

@ -868,8 +868,8 @@ export class EditorService extends Meta2d {
tags: ['robot'],
x: 0,
y: 0,
width: 74,
height: 74,
width: 120,
height: 120,
lineWidth: 1,
robot: { type },
visible: false,
@ -890,8 +890,8 @@ export class EditorService extends Meta2d {
if (!robot?.type) return;
const { x: ox, y: oy } = this.getPenRect(pen!);
const { x: cx = 37, y: cy = 37, active, angle, path: points, isWaring, isFault } = info;
const x = cx - 37;
const y = cy - 37;
const x = cx - 60;
const y = cy - 60;
const rotate = angle ?? or;
const path =
points?.map((p) => ({ x: p.x - cx, y: p.y - cy })) ??
@ -918,7 +918,7 @@ export class EditorService extends Meta2d {
// 使用优化的像素对齐算法,确保小车和光圈精确重合
const iconTop = this.#calculatePixelAlignedOffset(-10);
return { image, iconWidth: 34, iconHeight: 54, iconTop };
return { image, iconWidth: 37, iconHeight: 54, iconTop };
}
//#endregion