Skip to content

Commit

Permalink
Fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia3546 committed Mar 13, 2024
1 parent c938a18 commit 5c033df
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Sources/Views/DayCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,17 @@ final class DayCell: JTACDayCell {
self.rangeViewLeftAnchorToCenterConstraint = self.backgroundRangeView.leftAnchor.constraint(equalTo: self.contentView.centerXAnchor)

// Add small offset to prevent spacing between cells
self.rangeViewRightAnchorToSuperviewConstraint = self.backgroundRangeView.rightAnchor.constraint(equalTo: self.contentView.rightAnchor, constant: 1)
self.rangeViewRightAnchorToCenterConstraint = self.backgroundRangeView.rightAnchor.constraint(equalTo: self.contentView.centerXAnchor)
self.rangeViewRightAnchorToSuperviewConstraint = self.backgroundRangeView.rightAnchor.constraint(
equalTo: self.contentView.rightAnchor,
constant: 1
)
self.rangeViewRightAnchorToCenterConstraint = self.backgroundRangeView.rightAnchor
.constraint(equalTo: self.contentView.centerXAnchor)

NSLayoutConstraint.activate([
self.rangeViewLeftAnchorToSuperviewConstraint,
self.rangeViewRightAnchorToSuperviewConstraint
].compactMap{ $0 })
].compactMap { $0 })

NSLayoutConstraint.activate([
{
Expand All @@ -136,7 +140,7 @@ final class DayCell: JTACDayCell {
self.selectionBackgroundView.widthAnchor.constraint(equalTo: self.selectionBackgroundView.heightAnchor)
])
self.rangeViewTopAnchorConstraints = [
self.backgroundRangeView.topAnchor.constraint(equalTo: self.contentView.topAnchor, constant: inset),
self.backgroundRangeView.topAnchor.constraint(equalTo: self.contentView.topAnchor, constant: inset)
]
self.rangeViewBottomAnchorConstraints = [
self.backgroundRangeView.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor, constant: -inset)
Expand Down Expand Up @@ -298,7 +302,7 @@ final class DayCell: JTACDayCell {
} else {
self.dateLabel.isHidden = true
}

self.backgroundRangeView.isHidden = false
self.backgroundRangeView.layer.maskedCorners = []

Expand Down

0 comments on commit 5c033df

Please sign in to comment.