Skip to content

Commit

Permalink
Clean up the code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
buh committed May 8, 2022
1 parent a45853f commit 8115e63
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CompactSliderDemo/Shared/AdvancedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,16 @@ struct AdvancedView: View {
.padding(.horizontal, 8)
.background(
Capsule().fill(
LinearGradient(colors: [.green, .green, .yellow, .yellow], startPoint: .leading, endPoint: .trailing)
LinearGradient(
colors: [.green, .green, .yellow, .yellow],
startPoint: .leading,
endPoint: .trailing
)
)
)
.offset(
x: sliderState2.dragLocationX.lower + (sliderState2.dragLocationX.upper - sliderState2.dragLocationX.lower) / 2
x: sliderState2.dragLocationX.lower
+ (sliderState2.dragLocationX.upper - sliderState2.dragLocationX.lower) / 2
+ (sliderState2.lowerProgress < 0.1
? 30
: (sliderState2.lowerProgress > 0.9 ? -40 : 1)),
Expand Down

0 comments on commit 8115e63

Please sign in to comment.