Skip to content

Commit

Permalink
Making the difference to 3 times the padding to account for padding u…
Browse files Browse the repository at this point in the history
…nderneath
  • Loading branch information
nerdsupremacist committed Jul 22, 2020
1 parent bc379b6 commit 29943b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Snap/SnapCalculator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ extension SnapPointCalculator {

let results = snaps.map { input -> SnapResult in
let offset = input.point.offset(deviceHeight: deviceHeight, safeAreaInsets: safeAreaInsets)
let contentHeight = deviceHeight - safeAreaInsets.top - safeAreaInsets.bottom - handleThickness - 2 * handleVerticalPadding - offset
let contentHeight = deviceHeight - safeAreaInsets.top - safeAreaInsets.bottom - handleThickness - 3 * handleVerticalPadding - offset
return SnapResult(state: input.state,
offset: offset + safeAreaInsets.bottom,
contentHeight: contentHeight)
Expand All @@ -95,7 +95,7 @@ extension SnapPoint {
case .fraction(let fraction):
return deviceHeight * (1 - fraction)
case .height(let height):
let totalHeight = height + safeAreaInsets.top + safeAreaInsets.bottom + handleThickness + 2 * handleVerticalPadding
let totalHeight = height + safeAreaInsets.top + safeAreaInsets.bottom + handleThickness + 3 * handleVerticalPadding
return deviceHeight - totalHeight
case .paddingToTop(let offset):
return offset
Expand Down

0 comments on commit 29943b7

Please sign in to comment.