Skip to content

Commit 992a2ef

Browse files
committed
📝 更新文档,增加备份文件说明和笔迹设计
1 parent a1612fd commit 992a2ef

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

docs-pg/笔迹涂鸦功能设计.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
为了让ipad、平板等设备能更好的利用这个软件,计划增加笔迹涂鸦功能。
2+
3+
笔迹涂鸦功能是什么?
4+
5+
可以直接用笔或手指在屏幕上涂写,绘制自由的笔迹。但这些笔迹不会参与图论算法运算和连接。
6+
7+
底层原理:
8+
9+
笔迹(每一个笔画)是第一个出现的不可用有向边连接的Entity。曾经的实体都是ConnectableEntity。
10+
11+
笔迹拥有Entity的特性,例如:可以被选中、移动、删除、复制、粘贴、放在Section中可以被Section的拖动而连带移动。
12+
13+
问题:Entity抽象类要求对象必须拥有uuid,但似乎笔迹不太需要uuid?
14+
15+
笔迹本质上是不同粗细的折线段。
16+
17+
```json
18+
{
19+
"draw": [
20+
"12.35,45.67,15 23.45,56.78,20 34.56,67.89,15",
21+
"12.35,45.67,15 23.45,56.78,20 34.56,67.89,15",
22+
"12.35,45.67,15 23.45,56.78,20 34.56,67.89,15"
23+
]
24+
}
25+
```
26+
27+
draw字段是一个数组,数组中的每一个字符串都是一个笔画。(这里对笔画的定义是:绘制过程中笔从开始按下到松开的一笔画)
28+
29+
笔画的字符串结构如下:
30+
31+
```json
32+
"x1,y1,w1 x2,y2,w2 x3,y3,w3 ..."
33+
```
34+
35+
其中为了保证字符串不会太长,每个坐标都保留两位小数,第三个参数w是笔画的粗细,取整处理

docs/faq.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ sudo xattr -r -d com.apple.quarantine /Applications/Project\ Graph.app
1313
```
1414

1515
Input your password when prompted. This command will remove the quarantine attribute from the app, allowing it to be opened normally.
16+
17+
## Auto Backup
18+
19+
If the JSON project file is directly placed on the desktop, a backup file with a white icon may appear at times during editing. If no special situation occurs (such as sudden file corruption), the backup file can be manually deleted.
20+
21+
> [!TIP]
22+
> If you do not want to see too many backup files, you can disable auto backup in the settings. We actually recommend placing each JSON project file in a specific folder. This way, images pasted into the project can be automatically saved to this folder, avoiding mixing with images from other project files.
23+
24+
### How to Restore Backup Files?
25+
26+
You can rename one of the backup files to change its extension back to json and overwrite the original json file. Each backup file contains a timestamp, so you can choose one that is more recent for restoration.

docs/zh/faq.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ sudo xattr -r -d com.apple.quarantine /Applications/Project\ Graph.app
1313
```
1414

1515
提示 `Password:` 时输入你的开机密码(不会显示在屏幕上,直接输入即可),然后回车确认。
16+
17+
## 自动备份
18+
19+
如果json工程文件直接放在了桌面上,在编辑时没过一段时间可能会出现一个白色图标的backup备份文件,如果没有发生特殊情况(如突然坏档),可以手动删除这些备份文件。
20+
21+
> [!TIP]
22+
> 如果不想看到太多备份文件,可以在设置里直接关闭自动备份。实际上我们更建议每个json工程文件放在一个特定的文件夹里,这样还可以保证粘贴进来的图片都能自动保存到这个文件夹里,不会和其他的工程文件的图片混在一起。
23+
24+
### 备份文件如何恢复?
25+
26+
可以将其中一个backup文件直接改后缀名,改回json,将原来的json文件覆盖即可。每个备份文件都有时间,可以挑一个较近的恢复。

0 commit comments

Comments
 (0)