diff --git a/Apps/Examples/Examples/FioriSwiftUICore/DataTable/DataTableExample.swift b/Apps/Examples/Examples/FioriSwiftUICore/DataTable/DataTableExample.swift index 77d5637ec..322a42745 100644 --- a/Apps/Examples/Examples/FioriSwiftUICore/DataTable/DataTableExample.swift +++ b/Apps/Examples/Examples/FioriSwiftUICore/DataTable/DataTableExample.swift @@ -98,7 +98,6 @@ struct DataTableExample: View { .rowAlignment(.baseline) .showListView(true) .frame(width: 343, height: 124) - .border(Color.gray, width: 1) .disabled(true)) NavigationLink("Example 2", diff --git a/Sources/FioriCharts/Charts/HarveyBallMicroChart/HarveyBallMicroChart.swift b/Sources/FioriCharts/Charts/HarveyBallMicroChart/HarveyBallMicroChart.swift index a3795076c..babecb801 100644 --- a/Sources/FioriCharts/Charts/HarveyBallMicroChart/HarveyBallMicroChart.swift +++ b/Sources/FioriCharts/Charts/HarveyBallMicroChart/HarveyBallMicroChart.swift @@ -28,12 +28,12 @@ struct HarveyBallMicroChart: View { if fraction != nil && total != nil { Spacer() ZStack(alignment: .center) { - ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360)) - .strokeBorder(total!.color, lineWidth: radius) + Circle() + .fill(total!.color) .frame(width: radius * 2, height: radius * 2) - ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: Double(fraction!.value) * 360 / Double(total!.value))) - .strokeBorder(fraction!.color, lineWidth: radius - depth) + ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: Double(fraction!.value) * 360 / Double(total!.value)), insetAmount: (radius - depth) / 2) + .stroke(fraction!.color, lineWidth: radius - depth) .frame(width: (radius - depth) * 2, height: (radius - depth) * 2) } diff --git a/Sources/FioriCharts/Charts/RadialMicroChart/RadialMicroChart.swift b/Sources/FioriCharts/Charts/RadialMicroChart/RadialMicroChart.swift index 2596a0551..8f7f32856 100644 --- a/Sources/FioriCharts/Charts/RadialMicroChart/RadialMicroChart.swift +++ b/Sources/FioriCharts/Charts/RadialMicroChart/RadialMicroChart.swift @@ -62,10 +62,10 @@ struct RadialMicroChart: View { let depth = val > RadialMicroChart.maxDepth ? RadialMicroChart.maxDepth : (val < RadialMicroChart.minDepth ? RadialMicroChart.minDepth : val) return ZStack { - ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360)) - .strokeBorder(total!.color, lineWidth: depth) - ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: ratio * 360)) - .strokeBorder(percentage!.color, lineWidth: depth) + ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 360), insetAmount: depth / 2) + .stroke(total!.color, lineWidth: depth) + ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: ratio * 360), insetAmount: depth / 2) + .stroke(percentage!.color, lineWidth: depth) }.frame(width: radius * 2, height: radius * 2, alignment: .topLeading) } } diff --git a/Sources/FioriCharts/Common/Views/ArcShape.swift b/Sources/FioriCharts/Common/Views/ArcShape.swift index a9c2abace..3b74f665f 100644 --- a/Sources/FioriCharts/Common/Views/ArcShape.swift +++ b/Sources/FioriCharts/Common/Views/ArcShape.swift @@ -17,10 +17,10 @@ struct ArcShape: InsettableShape { let rotationAdjustment = Angle.degrees(90) let modifiedStart = self.startAngle - rotationAdjustment let modifiedEnd = self.endAngle - rotationAdjustment - + let radius = min(rect.size.width, rect.size.height) / 2 - self.insetAmount var path = Path() - path.addArc(center: CGPoint(x: rect.midX, y: rect.midY), radius: rect.width / 2 - self.insetAmount, startAngle: modifiedStart, endAngle: modifiedEnd, clockwise: !self.clockwise) + path.addArc(center: CGPoint(x: rect.midX, y: rect.midY), radius: radius, startAngle: modifiedStart, endAngle: modifiedEnd, clockwise: !self.clockwise) return path } @@ -29,28 +29,23 @@ struct ArcShape: InsettableShape { struct ArcShape_Previews: PreviewProvider { static var previews: some View { Group { - ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 90)) - .strokeBorder(Color.red) + ArcShape(startAngle: Angle(degrees: 0), endAngle: Angle(degrees: 90), insetAmount: 0.5) + .stroke(Color.red, lineWidth: 1) .frame(width: 200, height: 200) .previewLayout(.sizeThatFits) - ArcShape(startAngle: Angle(degrees: 20), endAngle: Angle(degrees: 360)) - .strokeBorder(Color.red, lineWidth: 40) + ArcShape(startAngle: Angle(degrees: 20), endAngle: Angle(degrees: 360), insetAmount: 20) + .stroke(Color.red, lineWidth: 40) .frame(width: 200, height: 200) .previewLayout(.sizeThatFits) - -// ArcShape(startAngle: Angle(degrees: 20), endAngle: Angle(degrees: 360)) -// .stroke(Color.red, lineWidth: 40) -// .frame(width: 200, height: 200) -// .previewLayout(.sizeThatFits) - - ArcShape(startAngle: Angle(degrees: 20), endAngle: Angle(degrees: 270), clockwise: false) - .strokeBorder(Color.red, lineWidth: 100) + + ArcShape(startAngle: Angle(degrees: 20), endAngle: Angle(degrees: 270), clockwise: false, insetAmount: 50) + .stroke(Color.red, lineWidth: 100) .frame(width: 200, height: 200) .previewLayout(.sizeThatFits) - ArcShape(startAngle: Angle(degrees: 20), endAngle: Angle(degrees: 21)) - .strokeBorder(Color.red, lineWidth: 40) + ArcShape(startAngle: Angle(degrees: 20), endAngle: Angle(degrees: 21), insetAmount: 20) + .stroke(Color.red, lineWidth: 40) .frame(width: 200, height: 200) .previewLayout(.sizeThatFits) } diff --git a/Sources/FioriSwiftUICore/DimensionSelector/DimensionSelector.swift b/Sources/FioriSwiftUICore/DimensionSelector/DimensionSelector.swift index 604d56e44..a290f1016 100644 --- a/Sources/FioriSwiftUICore/DimensionSelector/DimensionSelector.swift +++ b/Sources/FioriSwiftUICore/DimensionSelector/DimensionSelector.swift @@ -269,7 +269,11 @@ extension DimensionSelector { .padding(insets) .font(getSegmentAttributes()?.font) .foregroundColor(getSegmentAttributes()?.textColor) - .background(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous).strokeBorder(getSegmentAttributes()!.borderColor!, lineWidth: getSegmentAttributes()!.borderWidth!, antialiased: true)) + .background( + RoundedRectangle(cornerRadius: cornerRadius, style: .continuous) + .inset(by: getSegmentAttributes()!.borderWidth! / 2.0) + .stroke(getSegmentAttributes()!.borderColor!, lineWidth: getSegmentAttributes()!.borderWidth!) + ) .background(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous).fill(getSegmentAttributes()!.backgroundColor!)) } diff --git a/Sources/FioriSwiftUICore/Views/CustomBuilder/AvatarsBuilder.swift b/Sources/FioriSwiftUICore/Views/CustomBuilder/AvatarsBuilder.swift index adbeecc95..48ecbad22 100644 --- a/Sources/FioriSwiftUICore/Views/CustomBuilder/AvatarsBuilder.swift +++ b/Sources/FioriSwiftUICore/Views/CustomBuilder/AvatarsBuilder.swift @@ -21,7 +21,8 @@ public extension AvatarList { .clipShape(Capsule()) .overlay { Capsule() - .strokeBorder(borderColor, lineWidth: borderWidth) + .inset(by: borderWidth / 2.0) + .stroke(borderColor, lineWidth: borderWidth) } } else { avatar diff --git a/Sources/FioriSwiftUICore/Views/CustomBuilder/FootnoteIconsBuilder.swift b/Sources/FioriSwiftUICore/Views/CustomBuilder/FootnoteIconsBuilder.swift index d72e7be9c..551ea8a94 100644 --- a/Sources/FioriSwiftUICore/Views/CustomBuilder/FootnoteIconsBuilder.swift +++ b/Sources/FioriSwiftUICore/Views/CustomBuilder/FootnoteIconsBuilder.swift @@ -27,10 +27,12 @@ public extension FootnoteIconList { Group { if isCircular { Capsule() - .strokeBorder(Color.preferredColor(.separator), lineWidth: 0.33) + .inset(by: 0.33 / 2.0) + .stroke(Color.preferredColor(.separator), lineWidth: 0.33) } else { Rectangle() - .strokeBorder(Color.preferredColor(.separator), lineWidth: 0.33) + .inset(by: 0.33 / 2.0) + .stroke(Color.preferredColor(.separator), lineWidth: 0.33) } } }