mirror of
https://github.com/Melorise/TamaASR.git
synced 2026-11-07 14:39:32 +00:00
feat: 完成托盘设置页和悬浮球交互
实现隐藏启动、就绪状态托盘、登录提醒、后端切换、快捷键与自启动设置、九宫格和坐标微调,以及常驻悬浮球点击录音。 AI-assisted-by: Codex AI-model: gpt-5.6-sol AI-reasoning-effort: medium Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { clampPosition, presetPosition } from '../src/main/overlay-position';
|
||||
|
||||
const workArea = { x: 100, y: 50, width: 1200, height: 800 };
|
||||
const size = { width: 88, height: 88 };
|
||||
|
||||
test('九宫格预设基于屏幕工作区计算', () => {
|
||||
assert.deepEqual(presetPosition(workArea, size, 'top-left'), { x: 132, y: 82 });
|
||||
assert.deepEqual(presetPosition(workArea, size, 'middle-center'), { x: 656, y: 406 });
|
||||
assert.deepEqual(presetPosition(workArea, size, 'bottom-right'), { x: 1180, y: 730 });
|
||||
});
|
||||
|
||||
test('精确坐标被限制在工作区内', () => {
|
||||
assert.deepEqual(clampPosition({ x: -500, y: 2000 }, workArea, size), { x: 100, y: 762 });
|
||||
});
|
||||
Reference in New Issue
Block a user