From 893be125979745cd3d262b10f0cbd1f329b1ef70 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 26 Dec 2021 00:12:21 +0000 Subject: [PATCH] Removed vertical lines for single byte annotation items --- .../HexViewerWidget/AnnotationItem.cpp | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp index cc66a651..36baa423 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/AnnotationItem.cpp @@ -70,26 +70,29 @@ void AnnotationItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* op ); painter->setPen(lineColor); - painter->drawLine(QLine( - ByteItem::WIDTH / 2, - verticalLineYStart, - ByteItem::WIDTH / 2, - verticalLineYEnd - )); - painter->drawLine(QLine( - this->width - (ByteItem::WIDTH / 2), - verticalLineYStart, - this->width - (ByteItem::WIDTH / 2), - verticalLineYEnd - )); + if (this->size > 1) { + painter->drawLine(QLine( + ByteItem::WIDTH / 2, + verticalLineYStart, + ByteItem::WIDTH / 2, + verticalLineYEnd + )); - painter->drawLine(QLine( - ByteItem::WIDTH / 2, - verticalLineYEnd, - (ByteItem::WIDTH / 2) + (this->width - ByteItem::WIDTH), - verticalLineYEnd - )); + painter->drawLine(QLine( + this->width - (ByteItem::WIDTH / 2), + verticalLineYStart, + this->width - (ByteItem::WIDTH / 2), + verticalLineYEnd + )); + + painter->drawLine(QLine( + ByteItem::WIDTH / 2, + verticalLineYEnd, + (ByteItem::WIDTH / 2) + (this->width - ByteItem::WIDTH), + verticalLineYEnd + )); + } painter->drawLine(QLine( this->width / 2,