From b0b99c2dde89d0d26fcc3749bcf6d5e178f97c19 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 25 Dec 2021 03:49:25 +0000 Subject: [PATCH] Account for bottom annotations on final row in hex viewier --- .../HexViewerWidget/ByteItemGraphicsScene.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp index 64e25aab..490c0b45 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/ByteItemGraphicsScene.cpp @@ -168,15 +168,16 @@ void ByteItemGraphicsScene::adjustSize(bool forced) { this->adjustByteItemPositions(); this->adjustAnnotationItemPositions(); - const auto lastByteItemPosition = (--this->byteItemsByAddress.end())->second->pos(); + const auto* lastByteItem = (--this->byteItemsByAddress.end())->second; + const auto sceneHeight = static_cast( + lastByteItem->pos().y() + ByteItem::HEIGHT + AnnotationItem::BOTTOM_HEIGHT + this->margins.bottom() + ); + this->setSceneRect( 0, 0, width, - std::max( - static_cast(lastByteItemPosition.y() + ByteItem::HEIGHT + this->margins.bottom()), - this->parent->height() - ) + std::max(sceneHeight, this->parent->height()) ); }