Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
aure committed Sep 11, 2022
1 parent 01c0393 commit 85b831c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Demo/Shared/RibbonDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct RibbonDemoView: View {
height: proxy.size.height / 10)
Ribbon(position: $position)
.foregroundColor(.white.opacity(0.5))
.cornerRadius(1000)
.cornerRadius(20)
.frame(height: proxy.size.height / 10)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Controls/Implementations/Ribbon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public struct Ribbon: View {
var foregroundColor: Color = .red
var cornerRadius: CGFloat = 0
var indicatorPadding: CGFloat = 0.07
var indicatorWidth: CGFloat = 100
var indicatorWidth: CGFloat = 40

/// Initialize with the minimum description
/// - Parameter position: Normalized position of the ribbon
Expand Down
13 changes: 7 additions & 6 deletions Tests/ControlsTests/ControlsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ final class ControlsTests: XCTestCase {

let rect = CGRect(x: 0, y: 0, width: 100, height: 100)
(value1, value2) = geometry.calculateValuePair(value1: value1,
range1: 0 ... 100,
value2: value2,
range2: -100 ... 0,
from: CGPoint(x: rect.midX, y: rect.midY),
to: CGPoint(x: rect.maxX, y: rect.minY),
inRect: rect)
range1: 0 ... 100,
value2: value2,
range2: -100 ... 0,
from: CGPoint(x: rect.midX, y: rect.midY),
to: CGPoint(x: rect.maxX, y: rect.minY),
inRect: rect,
padding: .zero)

XCTAssertEqual(value1, 100)
XCTAssertEqual(value2, 0)
Expand Down

0 comments on commit 85b831c

Please sign in to comment.