Skip to content

Commit

Permalink
Fix draw for slider when it not under NSLayoutConstraint.
Browse files Browse the repository at this point in the history
spromicky committed Jan 18, 2017
1 parent dd1825a commit 8e4f030
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions StepSlider/source/StepSlider/StepSlider.m
Original file line number Diff line number Diff line change
@@ -143,8 +143,14 @@ - (void)layoutLayersAnimated:(BOOL)animated

contentSize = CGSizeMake(fmaxf(44.f, self.bounds.size.width), fmaxf(44.f, sliderHeightWithLabels));
if (!CGSizeEqualToSize(self.bounds.size, contentSize)) {
[self invalidateIntrinsicContentSize];
return;
if (self.constraints.count) {
[self invalidateIntrinsicContentSize];
return;
} else {
CGRect newFrame = self.frame;
newFrame.size = contentSize;
self.frame = newFrame;
}
}

CGFloat contentFrameY = (self.bounds.size.height - sliderHeightWithLabels) / 2.f;

0 comments on commit 8e4f030

Please sign in to comment.