From 4a08b8ba2c9f288ea8d44b37ba58eedf38b10192 Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 1 Dec 2021 22:14:54 +0000 Subject: [PATCH] Tidying --- .../Widgets/TargetWidgets/DIP/BodyWidget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/BodyWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/BodyWidget.cpp index 1adc4194..3f16fbf3 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/BodyWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/BodyWidget.cpp @@ -4,6 +4,13 @@ using namespace Bloom::Widgets::InsightTargetWidgets::Dip; BodyWidget::BodyWidget(QWidget* parent, std::size_t pinCount): QWidget(parent) { this->setObjectName("target-body"); + + /* + * The DIP package widget looks awkward when the body height is fixed. For this reason, the body height and + * indicator sizes are proportional to the pin count. + * + * The proportionality constants used below were chosen because they look the nicest. No other reason. + */ this->setFixedHeight( std::min( BodyWidget::MAXIMUM_BODY_HEIGHT, @@ -52,7 +59,7 @@ void BodyWidget::drawWidget(QPainter& painter) { * the first pin. */ const auto orientationIndicatorRect = QRectF( - - (this->orientationIndicatorDiameter / 2), + -(this->orientationIndicatorDiameter / 2), (bodyHeight / 2) - (this->orientationIndicatorDiameter / 2), this->orientationIndicatorDiameter, this->orientationIndicatorDiameter