From 2c8c0c84a6945747e5dcc85f30cf6b7dcb723e76 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Mon, 4 Dec 2023 19:22:07 +0100 Subject: [PATCH] [orx-shapes] Change default selection of adjustContour to select all --- orx-shapes/src/commonMain/kotlin/adjust/ContourAdjuster.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/orx-shapes/src/commonMain/kotlin/adjust/ContourAdjuster.kt b/orx-shapes/src/commonMain/kotlin/adjust/ContourAdjuster.kt index 1062482f..2ff88d01 100644 --- a/orx-shapes/src/commonMain/kotlin/adjust/ContourAdjuster.kt +++ b/orx-shapes/src/commonMain/kotlin/adjust/ContourAdjuster.kt @@ -32,12 +32,12 @@ class ContourAdjuster(var contour: ShapeContour) { /** * selected vertex indices */ - var vertexSelection = listOf(0) + var vertexSelection = List(contour.segments.size + if (contour.closed) 1 else 0) { it } /** * selected edge indices */ - var edgeSelection = listOf(0) + var edgeSelection = List(contour.segments.size) { it } private var vertexWorkingSet = emptyList() private var edgeWorkingSet = emptyList() @@ -148,6 +148,8 @@ class ContourAdjuster(var contour: ShapeContour) { (0 until if (contour.closed) contour.segments.size else contour.segments.size + 1).filter(predicate) } + + /** * select multiple vertices using an index-vertex based [predicate] */