From 9d383f6410ffa2f75dae2774b2f46ba683a3bf54 Mon Sep 17 00:00:00 2001 From: ParkSuMin Date: Tue, 9 Dec 2025 18:53:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B8=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20point=5Fref?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Canvas.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Canvas.cpp b/Canvas.cpp index cbfd5a0..fe7af21 100644 --- a/Canvas.cpp +++ b/Canvas.cpp @@ -34,9 +34,9 @@ Point* Canvas::findPointAt(QPointF pos, qreal tolerance) QPointF p2(*line->p2.x, *line->p2.y); if (dist_P2P(p1, pos) <= tolerance) - temp = &line->p1; + temp = line->p1_ref; else if (dist_P2P(p2, pos) <= tolerance) - temp = &line->p2; + temp = line->p2_ref; } return temp; } @@ -214,8 +214,8 @@ void Canvas::mousePressEvent(QMouseEvent* event) Line *l1 = nullptr, *l2 = nullptr; for (Line* l : lines) { - if (&l->p1 == firstPoint || &l->p2 == firstPoint) l1 = l; - if (&l->p1 == clickedPoint || &l->p2 == clickedPoint) l2 = l; + if (l->p1_ref == firstPoint || l->p2_ref == firstPoint) l1 = l; + if (l->p1_ref == clickedPoint || l->p2_ref == clickedPoint) l2 = l; } if (l1 == l2 ||