[orx-shapes] Add ContourAdjuster tests, fix bug in edge transform

This commit is contained in:
Edwin Jakobs
2023-12-07 18:02:34 +01:00
parent ab4c970ee0
commit 0b27dc735c
3 changed files with 104 additions and 4 deletions

View File

@@ -233,8 +233,10 @@ data class ContourEdge(
} else {
refIn.cubic.control
}
control[1] = control[1].transformedBy(transform)
newSegments[segmentInIndex] = refIn.copy(end = segment.start.transformedBy(transform), control = control)
if (control.isNotEmpty()) {
control[1] = control[1].transformedBy(transform)
}
newSegments[segmentInIndex] = refIn.copy(end = segment.start.transformedBy(transform))
}
if (refOut != null) {
val control = if (refOut.linear || !updateTangents) {
@@ -242,7 +244,9 @@ data class ContourEdge(
} else {
refOut.cubic.control
}
control[0] = control[0].transformedBy(transform)
if (control.isNotEmpty()) {
control[0] = control[0].transformedBy(transform)
}
newSegments[segmentOutIndex] = refOut.copy(start = segment.end.transformedBy(transform))
}