Skip to content

Commit abd2159

Browse files
committed
🐛 涂鸦显示在最顶部
1 parent 416a5b8 commit abd2159

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

app/src/core/render/canvas2d/entityRenderer/EntityRenderer.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,14 @@ export namespace EntityRenderer {
9393
export function renderAllEntities(viewRectangle: Rectangle) {
9494
let renderedNodes = 0;
9595

96-
// 2 遍历所有非section实体
96+
// 2 遍历所有非section实体 / 非涂鸦实体
9797
for (const entity of StageManager.getEntities()) {
9898
if (entity instanceof Section) {
9999
continue;
100100
}
101+
if (entity instanceof PenStroke) {
102+
continue;
103+
}
101104
// 视线之外不画
102105
if (Renderer.isOverView(viewRectangle, entity)) {
103106
continue;
@@ -112,6 +115,13 @@ export namespace EntityRenderer {
112115
}
113116
SectionRenderer.render(section);
114117
}
118+
// 4 遍历所有涂鸦实体
119+
for (const penStroke of StageManager.getPenStrokes()) {
120+
if (Renderer.isOverView(viewRectangle, penStroke)) {
121+
continue;
122+
}
123+
EntityRenderer.renderEntity(penStroke);
124+
}
115125
return renderedNodes;
116126
}
117127

app/src/core/stage/stageManager/concreteMethods/StageObjectColorManager.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ export namespace StageObjectColorManager {
1717
node.color = color;
1818
}
1919
}
20+
for (const entity of StageManager.getPenStrokes()) {
21+
if (entity.isSelected) {
22+
// TODO: 涂鸦应该可以改颜色
23+
}
24+
}
2025
}
2126

2227
export function clearEntityColor() {

0 commit comments

Comments
 (0)