From 1afd21fd7734f5a09f595d7297e7f53307702690 Mon Sep 17 00:00:00 2001 From: DSCaskey <31944718+DSCaskey@users.noreply.github.com> Date: Sat, 23 Nov 2024 03:20:20 -0500 Subject: [PATCH] limit length of grainline limit length of grainline to twice the length of a arrowhead. --- src/libs/vwidgets/vgrainlineitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libs/vwidgets/vgrainlineitem.cpp b/src/libs/vwidgets/vgrainlineitem.cpp index c200a8ccc985..83110e476e99 100644 --- a/src/libs/vwidgets/vgrainlineitem.cpp +++ b/src/libs/vwidgets/vgrainlineitem.cpp @@ -401,6 +401,12 @@ void VGrainlineItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event) { dLen *= 2; } + // limit length of grainline to twice the length of the arrowheads. + qreal minLength = qApp->Settings()->getDefaultArrowLength() * 2.0; + if (m_startLength + dLen < minLength) + { + return; + } m_length = m_startLength + dLen; QPointF pos;