From 0f064bf48ecc2372de6a60246ada6a6684f85e46 Mon Sep 17 00:00:00 2001 From: ParkSuMin Date: Mon, 15 Dec 2025 17:33:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=81=D0=B8=20Y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь ось Y направлена строго вверх --- Canvas.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Canvas.cpp b/Canvas.cpp index 3a0e0b4..28d813c 100644 --- a/Canvas.cpp +++ b/Canvas.cpp @@ -533,6 +533,7 @@ void Canvas::paintEvent(QPaintEvent* event) QPainter p(this); p.setRenderHint(QPainter::Antialiasing, true); p.translate(width() / 2.0, height() / 2.0); + p.scale(1.0, -1.0); p.setPen(Qt::red); p.drawLine(-5, 0, 5, 0); @@ -608,7 +609,7 @@ void Canvas::leaveEvent(QEvent* event) void Canvas::showObjectTag(QPointF pos) { QPointF l = screenToLogical(pos); - Line* lineUnderCursor = findAt(l, 2.0); + Line* lineUnderCursor = findAt(l, 1.0); if (lineUnderCursor && lineUnderCursor != draggedLine) { QPointF p1(*lineUnderCursor->p1.x, *lineUnderCursor->p1.y); QPointF p2(*lineUnderCursor->p2.x, *lineUnderCursor->p2.y); @@ -629,5 +630,7 @@ QPointF Canvas::screenToLogical(const QPointF& screenPos) const logical.rx() -= width() / 2.0; logical.ry() -= height() / 2.0; + logical.ry() = -logical.ry(); + return logical; -} +} \ No newline at end of file