From 20caefadf869135ac78332a77e00ee6a1fef609c Mon Sep 17 00:00:00 2001 From: Andrey Kalmykov Date: Sun, 23 Feb 2025 11:25:17 +0100 Subject: [PATCH] Make future wire more thicker when laying a new wire --- qucs/schematic.cpp | 8 +++++++- qucs/schematic_element.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/qucs/schematic.cpp b/qucs/schematic.cpp index fea89a802..002ed7cd7 100644 --- a/qucs/schematic.cpp +++ b/qucs/schematic.cpp @@ -584,9 +584,15 @@ void Schematic::drawPostPaintEvents(QPainter* painter) { painter->fillRect(p.x1, p.y1, p.x2, p.y2, QColor(200, 220, 240, 100)); painter->drawRect(p.x1, p.y1, p.x2, p.y2); break; - case _Line: + case _Line: { + painter->save(); + QPen lp{painter->pen()}; + lp.setWidth(p.a == 0 ? 1 : p.a); + painter->setPen(lp); painter->drawLine(p.x1, p.y1, p.x2, p.y2); + painter->restore(); break; + } case _Ellipse: painter->drawEllipse(p.x1, p.y1, p.x2, p.y2); break; diff --git a/qucs/schematic_element.cpp b/qucs/schematic_element.cpp index c563b9ac5..166e9d21f 100644 --- a/qucs/schematic_element.cpp +++ b/qucs/schematic_element.cpp @@ -3213,7 +3213,7 @@ void Schematic::showEphemeralWire(const QPoint& a, const QPoint& b) noexcept { for (std::size_t i = 1; i < points.size(); i++) { auto m = points[i-1]; auto n = points[i]; - PostPaintEvent(_Line, m.x(), m.y(), n.x(), n.y()); + PostPaintEvent(_Line, m.x(), m.y(), n.x(), n.y(), 3); } }