Arc: show the middle handle only with the size handles, uncovering the one under it

The middle handle of a half arc sits exactly on the middle of the top
or bottom edge of the ellipse -- a resize handle in Size mode, a skew
handle in RotateSkew mode -- and, drawn last, it covered that handle
(arummler, discussion #1203). It is now shown in Size mode only, where
the resize handle under it is hidden instead: the middle handle already
changes that height, with the ends kept in place. RotateSkew mode shows
its skew handle again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-02 06:12:09 +13:00
parent b6495b51a6
commit 4c0f51c476
2 changed files with 25 additions and 3 deletions
+24 -2
View File
@@ -1746,11 +1746,33 @@ void QetShapeItem::rebuildHandles()
updateArcBulgeVisibility();
}
/**
@brief QetShapeItem::updateArcBulgeVisibility
The middle handle of a half arc is shown with the Size handles only.
It sits exactly on one of them -- the middle of the top or bottom
edge (left or right for an upright arc) -- and on the top skew handle
in RotateSkew mode, and being drawn last it covered whichever one it
sat on. In Size mode the Resize handle under it is hidden instead:
the middle handle already changes that same height, keeping the ends
in place.
*/
void QetShapeItem::updateArcBulgeVisibility()
{
const int index = m_handleRoles.indexOf(HandleRole::ArcBulge);
if (index >= 0 && index < m_handler_vector.size())
m_handler_vector.at(index)->setVisible(isAxisHalfArc());
if (index < 0 || index >= m_handler_vector.size())
return;
const bool shown = isAxisHalfArc() && m_handleMode == HandleMode::Size;
m_handler_vector.at(index)->setVisible(shown);
const QPointF middle = handlePositionFor(HandleRole::ArcBulge, 0);
for (int i = 0; i < m_handler_vector.size() && i < m_handleRoles.size(); ++i)
{
if (m_handleRoles.at(i) != HandleRole::Resize)
continue;
const QPointF p = handlePositionFor(HandleRole::Resize, m_handleSlot.at(i));
m_handler_vector.at(i)->setVisible(!shown || QLineF(p, middle).length() > 0.01);
}
}
/**
+1 -1
View File
@@ -131,7 +131,7 @@ class QetShapeItem : public QetGraphicsItem
Rotate, SkewEdge, Pivot, // RotateSkew mode
CornerRadius, // Rectangle, always shown alongside Size handles
ArcEndpoint, // Ellipse, always shown
ArcBulge, // Ellipse, shown only on a half arc (see isAxisHalfArc())
ArcBulge, // Ellipse, Size mode, shown only on a half arc (see isAxisHalfArc())
PathAnchor, PathControlIn, PathControlOut // Polygon/Path, node-edit mode (see setPathNodes())
};