From 81e5c23093f07bcffe85cb9f02a848a8e774ca5e Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Wed, 10 Jan 2024 14:00:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/section/SectionDrawAssistant.ts | 26 ++++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index 87595d0..e2fdc0e 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -339,22 +339,16 @@ export class SectionGraphicHitArea implements IHitArea { function buildAbsorbablePositions(section: Section): AbsorbablePosition[] { const aps: AbsorbablePosition[] = []; - - const sectionRef = section.relationManage - .getRelationsOfGraphicAndOtherType(section, Section.Type) - .map((r) => r.getOtherGraphic
(section)); - sectionRef.forEach((other) => { - const [ps, pe] = [ - other.localToCanvasPoint(other.getStartPoint()), - other.localToCanvasPoint(other.getEndPoint()), - ]; - const { width, height } = section.getGraphicApp().canvas; - const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y }); - const ys = new AbsorbableLine({ x: ps.x, y: 0 }, { x: ps.x, y: height }); - 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 }); - aps.push(xs, ys, xe, ye); - }); + const [ps, pe] = [ + section.localToCanvasPoint(section.getStartPoint()), + section.localToCanvasPoint(section.getEndPoint()), + ]; + const { width, height } = section.getGraphicApp().canvas; + const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y }); + const ys = new AbsorbableLine({ x: ps.x, y: 0 }, { x: ps.x, y: height }); + 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 }); + aps.push(xs, ys, xe, ye); const sections = section.queryStore .queryByType
(Section.Type) .filter((g) => g.datas.sectionType == SectionType.Physical);