Skip to content

Commit

Permalink
Did some small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mneuwert committed Apr 28, 2011
1 parent 8fd9ffa commit 576a2b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ValueTrackingSlider/ValueTrackingSlider/MNEValueTrackingSlider.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ - (void)drawRect:(CGRect)rect {
// Set the fill color
[[UIColor colorWithWhite:0 alpha:0.8] setFill];

// Create the path for the rounded rectanble
CGRect roundedRect = CGRectMake(self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height * 0.8);
// Create the path for the rounded rectangle
CGRect roundedRect = CGRectMake(self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, floorf(self.bounds.size.height * 0.8));
UIBezierPath *roundedRectPath = [UIBezierPath bezierPathWithRoundedRect:roundedRect cornerRadius:6.0];

// Create the arrow path
Expand All @@ -54,7 +54,7 @@ - (void)drawRect:(CGRect)rect {
[arrowPath addLineToPoint:CGPointMake((midX + 10.0), CGRectGetMaxY(roundedRect))];
[arrowPath closePath];

// Attach the arrow path to the buble
// Attach the arrow path to the rounded rect
[roundedRectPath appendPath:arrowPath];

[roundedRectPath fill];
Expand Down Expand Up @@ -109,7 +109,7 @@ - (void)_fadePopupViewInAndOut:(BOOL)aFadeIn {

- (void)_positionAndUpdatePopupView {
CGRect _thumbRect = self.thumbRect;
CGRect popupRect = CGRectOffset(_thumbRect, 0, -(_thumbRect.size.height * 1.5));
CGRect popupRect = CGRectOffset(_thumbRect, 0, -floorf(_thumbRect.size.height * 1.5));
valuePopupView.frame = CGRectInset(popupRect, -20, -10);
valuePopupView.value = (NSInteger)self.value;
}
Expand Down Expand Up @@ -143,7 +143,7 @@ - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event {
// Fade in and update the popup view
CGPoint touchPoint = [touch locationInView:self];
// Check if the knob is touched. Only in this case show the popup-view
if(CGRectContainsPoint(self.thumbRect, touchPoint)) {
if(CGRectContainsPoint(CGRectInset(self.thumbRect, -12.0, -12.0), touchPoint)) {
[self _positionAndUpdatePopupView];
[self _fadePopupViewInAndOut:YES];
}
Expand Down

0 comments on commit 576a2b3

Please sign in to comment.