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