Skip to content

Commit c41723f

Browse files
committed
🐛 docs: 添加项目背景信息和开发注意事项
- 添加了项目背景信息文档,详细描述了Project Graph的功能、技术架构及核心模块。 - 添加了开发注意事项文档,强调了mac适配windows快捷键时应使用command键而非control键,UI新增内容需使用i18n适配英文和繁体中文,新增rust侧函数需确保其健壮性,避免抛出错误。 - 修正了MouseTipFeedbackEffect.tsx中的代码,将所有调用MouseLocation.vector()的地方改为MouseLocation.vector().clone(),以防止潜在的引用错误。
1 parent 51dcba7 commit c41723f

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

.fitten/rules/project_background.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Project Graph 背景信息
2+
3+
## 项目概述
4+
5+
Project Graph 是一个图形化思维桌面工具和知识管理系统,支持节点连接、图形渲染和自动布局等功能。
6+
7+
## 技术架构
8+
9+
- 前端:React + TypeScript
10+
- 后端:Tauri (Rust)
11+
- 构建工具:Vite + pnpm (monorepo)
12+
13+
## 核心功能模块
14+
15+
1. **图形渲染引擎**:基于Canvas 2D的实体渲染系统
16+
2. **控制服务**:鼠标/键盘交互控制、快捷键管理
17+
3. **数据服务**:文件加载、自动保存、协作引擎
18+
4. **反馈系统**:视觉特效和声音反馈
19+
20+
## 开发辅助
21+
22+
- 项目采用严格的代码规范和类型检查
23+
- 包含完善的文档系统(docs/)和测试用例
24+
- 支持插件系统扩展功能

.fitten/rules/开发注意.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 开发注意
2+
3+
开发mac适配windows快捷键部分时,不能用control键,用command键。
4+
UI上增加内容时,要使用i18n翻译适配英文和繁体中文。
5+
如果要增加rust侧的函数,一定要保证函数的健壮性,不能让他抛出错误

app/src/core/service/feedbackService/effectEngine/concrete/MouseTipFeedbackEffect.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,47 +76,47 @@ export class MouseTipFeedbackEffect extends EffectObject {
7676
} else if (this.type === "moveLeft") {
7777
// 鼠标向左移动,右边应该出现幻影
7878
CurveRenderer.renderGradientLine(
79-
MouseLocation.vector(),
79+
MouseLocation.vector().clone(),
8080
MouseLocation.vector().add(new Vector(100 * (1 - this.timeProgress.rate), 0)),
8181
StageStyleManager.currentStyle.effects.successShadow.toNewAlpha(1 - this.timeProgress.rate),
8282
StageStyleManager.currentStyle.effects.successShadow.toTransparent(),
8383
10 * (1 - this.timeProgress.rate),
8484
);
8585
} else if (this.type === "moveRight") {
8686
CurveRenderer.renderGradientLine(
87-
MouseLocation.vector(),
87+
MouseLocation.vector().clone(),
8888
MouseLocation.vector().add(new Vector(-100 * (1 - this.timeProgress.rate), 0)),
8989
StageStyleManager.currentStyle.effects.successShadow.toNewAlpha(1 - this.timeProgress.rate),
9090
StageStyleManager.currentStyle.effects.successShadow.toTransparent(),
9191
10 * (1 - this.timeProgress.rate),
9292
);
9393
} else if (this.type === "moveUp") {
9494
CurveRenderer.renderGradientLine(
95-
MouseLocation.vector(),
95+
MouseLocation.vector().clone(),
9696
MouseLocation.vector().add(new Vector(0, 100 * (1 - this.timeProgress.rate))),
9797
StageStyleManager.currentStyle.effects.successShadow.toNewAlpha(1 - this.timeProgress.rate),
9898
StageStyleManager.currentStyle.effects.successShadow.toTransparent(),
9999
10 * (1 - this.timeProgress.rate),
100100
);
101101
} else if (this.type === "moveDown") {
102102
CurveRenderer.renderGradientLine(
103-
MouseLocation.vector(),
103+
MouseLocation.vector().clone(),
104104
MouseLocation.vector().add(new Vector(0, -100 * (1 - this.timeProgress.rate))),
105105
StageStyleManager.currentStyle.effects.successShadow.toNewAlpha(1 - this.timeProgress.rate),
106106
StageStyleManager.currentStyle.effects.successShadow.toTransparent(),
107107
10 * (1 - this.timeProgress.rate),
108108
);
109109
} else if (this.type === "move") {
110110
CurveRenderer.renderGradientLine(
111-
MouseLocation.vector(),
111+
MouseLocation.vector().clone(),
112112
MouseLocation.vector().add(this.direction.multiply(-5 * (1 - this.timeProgress.rate))),
113113
StageStyleManager.currentStyle.StageObjectBorder.toNewAlpha(1 - this.timeProgress.rate),
114114
StageStyleManager.currentStyle.StageObjectBorder.toTransparent(),
115115
2 * (1 - this.timeProgress.rate),
116116
);
117117
} else if (this.type === "drag") {
118118
ShapeRenderer.renderCircle(
119-
MouseLocation.vector(),
119+
MouseLocation.vector().clone(),
120120
6 * (1 - this.timeProgress.rate),
121121
Color.Transparent,
122122
StageStyleManager.currentStyle.StageObjectBorder.toNewAlpha(1 - this.timeProgress.rate),
@@ -125,7 +125,7 @@ export class MouseTipFeedbackEffect extends EffectObject {
125125
} else if (this.type === "cameraMoveToMouse") {
126126
CurveRenderer.renderDashedLine(
127127
Renderer.transformWorld2View(Camera.location),
128-
MouseLocation.vector(),
128+
MouseLocation.vector().clone(),
129129
StageStyleManager.currentStyle.effects.successShadow.toNewAlpha(1 - this.timeProgress.rate),
130130
1,
131131
8,

0 commit comments

Comments
 (0)