This commit is contained in:
joylink_zhaoerwei 2024-01-10 14:00:23 +08:00
parent fc23bb11d5
commit 81e5c23093

View File

@ -339,14 +339,9 @@ export class SectionGraphicHitArea implements IHitArea {
function buildAbsorbablePositions(section: Section): AbsorbablePosition[] { function buildAbsorbablePositions(section: Section): AbsorbablePosition[] {
const aps: AbsorbablePosition[] = []; const aps: AbsorbablePosition[] = [];
const sectionRef = section.relationManage
.getRelationsOfGraphicAndOtherType(section, Section.Type)
.map((r) => r.getOtherGraphic<Section>(section));
sectionRef.forEach((other) => {
const [ps, pe] = [ const [ps, pe] = [
other.localToCanvasPoint(other.getStartPoint()), section.localToCanvasPoint(section.getStartPoint()),
other.localToCanvasPoint(other.getEndPoint()), section.localToCanvasPoint(section.getEndPoint()),
]; ];
const { width, height } = section.getGraphicApp().canvas; const { width, height } = section.getGraphicApp().canvas;
const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y }); const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y });
@ -354,7 +349,6 @@ function buildAbsorbablePositions(section: Section): AbsorbablePosition[] {
const xe = new AbsorbableLine({ x: 0, y: pe.y }, { x: width, y: pe.y }); const xe = new AbsorbableLine({ x: 0, y: pe.y }, { x: width, y: pe.y });
const ye = new AbsorbableLine({ x: pe.x, y: 0 }, { x: pe.x, y: height }); const ye = new AbsorbableLine({ x: pe.x, y: 0 }, { x: pe.x, y: height });
aps.push(xs, ys, xe, ye); aps.push(xs, ys, xe, ye);
});
const sections = section.queryStore const sections = section.queryStore
.queryByType<Section>(Section.Type) .queryByType<Section>(Section.Type)
.filter((g) => g.datas.sectionType == SectionType.Physical); .filter((g) => g.datas.sectionType == SectionType.Physical);