Commit 2b01ca9
committed
fix: 修复二叉树不在画布中心的问题
通过计算树的实际边界(minX, maxX),然后计算水平偏移量使树居中显示。
修改了Canvas组件中的绘制逻辑,在创建主容器时添加了centerOffsetX偏移。1 parent c906130 commit 2b01ca9
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
51 | 60 | | |
52 | 61 | | |
53 | | - | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
0 commit comments