Skip to content

Commit 5d769bf

Browse files
committed
Fix incorrect radius calculation in wrappedAroundCircle
The inferred radius was computed as x/π instead of x/(2π), causing geometry to wrap only halfway around the circle.
1 parent f8029f0 commit 5d769bf

File tree

1 file changed

+1
-1
lines changed
  • Sources/Cadova/Abstract Layer/Operations

1 file changed

+1
-1
lines changed

Sources/Cadova/Abstract Layer/Operations/Wrap.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public extension Geometry2D {
6666
func wrappedAroundCircle(radius: Double? = nil) -> any Geometry2D {
6767
measuringBounds { geometry, bounds in
6868
@Environment(\.scaledSegmentation) var segmentation
69-
let innerRadius = radius ?? bounds.maximum.x / .pi
69+
let innerRadius = radius ?? bounds.maximum.x / 2 / .pi
7070
let maximumRadius = innerRadius + bounds.maximum.y
7171
let segmentLength = (maximumRadius * 2 * .pi) / Double(segmentation.segmentCount(circleRadius: maximumRadius))
7272
let innerCircumference = innerRadius * 2 * .pi

0 commit comments

Comments
 (0)