Skip to content

Commit f24767e

Browse files
committed
🐛 fix: #377 当涂鸦和图片叠在一起时,点击涂鸦会点击到图片
1 parent 01e520a commit f24767e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/src/core/stage/stageManager/StageManager.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,19 @@ export namespace StageManager {
562562
return null;
563563
}
564564

565+
/**
566+
* 优先级:
567+
* 涂鸦 > 其他
568+
* @param location
569+
* @returns
570+
*/
565571
export function findEntityByLocation(location: Vector): Entity | null {
572+
for (const penStroke of getPenStrokes()) {
573+
if (penStroke.isHiddenBySectionCollapse) continue;
574+
if (penStroke.collisionBox.isContainsPoint(location)) {
575+
return penStroke;
576+
}
577+
}
566578
for (const entity of getEntities()) {
567579
if (entity.isHiddenBySectionCollapse) {
568580
continue;

0 commit comments

Comments
 (0)