diff --git a/src/widgets/DisassemblyWidget.cpp b/src/widgets/DisassemblyWidget.cpp index 032b4973..85e4f3e5 100644 --- a/src/widgets/DisassemblyWidget.cpp +++ b/src/widgets/DisassemblyWidget.cpp @@ -379,18 +379,21 @@ void DisassemblyWidget::zoomIn() { mDisasTextEdit->zoomIn(); updateMaxLines(); + leftPanel->update(); } void DisassemblyWidget::zoomOut() { mDisasTextEdit->zoomOut(); updateMaxLines(); + leftPanel->update(); } void DisassemblyWidget::zoomReset() { setupFonts(); updateMaxLines(); + leftPanel->update(); } void DisassemblyWidget::highlightCurrentLine() @@ -746,6 +749,12 @@ void DisassemblyScrollArea::resetScrollBars() verticalScrollBar()->blockSignals(false); } +qreal DisassemblyTextEdit::textOffset() const +{ + return (blockBoundingGeometry(document()->begin()).topLeft() + + contentOffset()).y(); +} + bool DisassemblyTextEdit::viewportEvent(QEvent *event) { switch (event->type()) { @@ -826,7 +835,7 @@ void DisassemblyLeftPanel::paintEvent(QPaintEvent *event) constexpr int arrowWidth = 5; int rightOffset = size().rwidth(); auto tEdit = qobject_cast(disas->getTextWidget()); - int topOffset = int(tEdit->document()->documentMargin() + tEdit->contentsMargins().top()); + int topOffset = int(tEdit->contentsMargins().top() + tEdit->textOffset()); int lineHeight = disas->getFontMetrics().height(); QColor arrowColorDown = ConfigColor("flow"); QColor arrowColorUp = ConfigColor("cflow"); diff --git a/src/widgets/DisassemblyWidget.h b/src/widgets/DisassemblyWidget.h index 0ca77855..b3621254 100644 --- a/src/widgets/DisassemblyWidget.h +++ b/src/widgets/DisassemblyWidget.h @@ -125,6 +125,7 @@ public: this->lockScroll = lock; } + qreal textOffset() const; protected: bool viewportEvent(QEvent *event) override; void scrollContentsBy(int dx, int dy) override;