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 ( if (
selectedElements.length === 0 || selectedElements.length === 0 ||
selectedElements.some( 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; return null;