diff --git a/src/widgets/DisassemblerGraphView.cpp b/src/widgets/DisassemblerGraphView.cpp index 38484b96..c84a90c5 100644 --- a/src/widgets/DisassemblerGraphView.cpp +++ b/src/widgets/DisassemblerGraphView.cpp @@ -152,6 +152,8 @@ DisassemblerGraphView::DisassemblerGraphView(QWidget *parent, CutterSeekable* se // Add header as widget to layout so it stretches to the layout width layout->setContentsMargins(0, 0, 0, 0); layout->setAlignment(Qt::AlignTop); + + this->scale_thickness_multiplier = true; } void DisassemblerGraphView::connectSeekChanged(bool disconn) @@ -601,6 +603,11 @@ GraphView::EdgeConfiguration DisassemblerGraphView::edgeConfiguration(GraphView: } ec.start_arrow = false; ec.end_arrow = true; + if (from.entry == currentBlockAddress) { + ec.width_scale = 2.0; + } else if (to->entry == currentBlockAddress) { + ec.width_scale = 2.0; + } return ec; } @@ -922,6 +929,8 @@ void DisassemblerGraphView::blockClicked(GraphView::GraphBlock &block, QMouseEve return; } + currentBlockAddress = block.entry; + highlight_token = getToken(instr, pos.x()); RVA addr = instr->addr; @@ -983,6 +992,7 @@ bool DisassemblerGraphView::helpEvent(QHelpEvent *event) void DisassemblerGraphView::blockTransitionedTo(GraphView::GraphBlock *to) { + currentBlockAddress = to->entry; if (transition_dont_seek) { transition_dont_seek = false; return; diff --git a/src/widgets/DisassemblerGraphView.h b/src/widgets/DisassemblerGraphView.h index b062dc44..4d4522cc 100644 --- a/src/widgets/DisassemblerGraphView.h +++ b/src/widgets/DisassemblerGraphView.h @@ -147,6 +147,7 @@ private: int charOffset; int baseline; bool emptyGraph; + ut64 currentBlockAddress = RVA_INVALID; DisassemblyContextMenu *blockMenu; QMenu *contextMenu; diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index 85e4f3e5..80fdcb94 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -918,9 +918,9 @@ void DisassemblyLeftPanel::paintEvent(QPaintEvent *event) bool jumpDown = l.arrow > l.offset; p.setPen(jumpDown ? penDown : penUp); - if (l.offset == currOffset) { + if (l.offset == currOffset || l.arrow == currOffset) { QPen pen = p.pen(); - pen.setWidth((penSizePix * 3) / 2); + pen.setWidthF((penSizePix * 3) / 2.0); p.setPen(pen); } bool endVisible = true; diff --git a/src/widgets/GraphView.cpp b/src/widgets/GraphView.cpp index 0602f53f..11c2052d 100644 --- a/src/widgets/GraphView.cpp +++ b/src/widgets/GraphView.cpp @@ -336,8 +336,12 @@ void GraphView::paintGraphCache() QPolygonF polyline = recalculatePolygon(edge.polyline); EdgeConfiguration ec = edgeConfiguration(block, &blocks[edge.target]); QPen pen(ec.color); - pen.setWidth(pen.width() / ec.width_scale); - if (pen.width() * current_scale < 2) { + pen.setStyle(ec.lineStyle); + pen.setWidthF(pen.width() * ec.width_scale); + if (scale_thickness_multiplier * ec.width_scale > 1.01 && pen.widthF() * current_scale < 2) { + pen.setWidthF(ec.width_scale / current_scale); + } + if (pen.widthF() * current_scale < 2) { pen.setWidth(0); } p.setPen(pen); diff --git a/src/widgets/GraphView.h b/src/widgets/GraphView.h index 4353a68c..26c2ac8e 100644 --- a/src/widgets/GraphView.h +++ b/src/widgets/GraphView.h @@ -38,6 +38,7 @@ public: bool start_arrow = false; bool end_arrow = true; qreal width_scale = 1.0; + Qt::PenStyle lineStyle = Qt::PenStyle::SolidLine; }; explicit GraphView(QWidget *parent); @@ -96,6 +97,7 @@ protected: int width = 0; int height = 0; + bool scale_thickness_multiplier = false; void clampViewOffset(); void setViewOffsetInternal(QPoint pos, bool emitSignal = true); @@ -125,9 +127,6 @@ private: int scroll_base_y = 0; bool scroll_mode = false; - // Todo: remove charheight/charwidth cause it should be handled in child class - qreal charWidth = 10.0; - bool useGL; /** diff --git a/src/widgets/OverviewView.cpp b/src/widgets/OverviewView.cpp index 6eeb4930..252f6c7e 100644 --- a/src/widgets/OverviewView.cpp +++ b/src/widgets/OverviewView.cpp @@ -137,7 +137,7 @@ GraphView::EdgeConfiguration OverviewView::edgeConfiguration(GraphView::GraphBlo auto baseEcIt = edgeConfigurations.find({from.entry, to->entry}); if (baseEcIt != edgeConfigurations.end()) ec = baseEcIt->second; - ec.width_scale = getViewScale(); + ec.width_scale = 1.0 / getViewScale(); return ec; }