Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Classes/DDPageControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#import "DDPageControl.h"


#define kDotDiameter 4.0f
#define kDotSpace 12.0f
#define kDotDiameter 5.0f
#define kDotSpace 11.0f


@implementation DDPageControl
Expand Down Expand Up @@ -83,10 +83,11 @@ - (void)drawRect:(CGRect)rect
CGFloat dotsWidth = self.numberOfPages * diameter + MAX(0, self.numberOfPages - 1) * space ;
CGFloat x = CGRectGetMidX(currentBounds) - dotsWidth / 2 ;
CGFloat y = CGRectGetMidY(currentBounds) - diameter / 2 ;
y += 0.5f; // Bump down to match UIPageControl

// get the caller's colors it they have been set or use the defaults
UIColor *drawOnColor = onColor ? onColor : [UIColor colorWithWhite: 1.0f alpha: 1.0f];
UIColor *drawOffColor = offColor ? offColor : [UIColor colorWithWhite: 0.7f alpha: 0.5f];
UIColor *drawOffColor = offColor ? offColor : [UIColor colorWithWhite: 1.0f alpha: 0.3f];

// actually draw the dots
for (int i = 0 ; i < numberOfPages ; i++)
Expand Down Expand Up @@ -282,4 +283,4 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
[self sendActionsForControlEvents: UIControlEventValueChanged] ;
}

@end
@end