TBD: only show polygon button for enabled polygons

This commit is contained in:
dwelle 2025-05-07 23:10:35 +02:00
parent 012076a3e9
commit 703e37f84c

View File

@ -166,7 +166,13 @@ export const actionToggleLoopLock = register({
if (
selectedElements.length === 0 ||
selectedElements.some(
(element) => !isLineElement(element) || element.points.length < 3,
(element) =>
!isLineElement(element) ||
// only show polygon button if every selected element is already
// a polygon, effectively showing this button only to allow for
// disabling the polygon state
!element.loopLock ||
element.points.length < 3,
)
) {
return null;