Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix for Calendar Month Grid with touch points. #174

Merged
merged 1 commit into from Mar 20, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/TapkuLibrary/TKCalendarMonthView.m
Expand Up @@ -487,6 +487,14 @@ - (NSDate*) dateSelected{
- (void) reactToTouch:(UITouch*)touch down:(BOOL)down{

CGPoint p = [touch locationInView:self];
/*
When a UIViewController allocated and pushViewController it in delegate.- (void)calendarMonthView:(TKCalendarMonthView *)monthView didSelectDate:(NSDate *)date.
p.x is over self.bounds.size.width(a cause -- unknown).
And column becomes 7 or more.
It is if it is the 4th [ or more ] row, App will crash (e.g. select 2012/07/29).
So I added check range of p.x.
*/
if(p.x > self.bounds.size.width || p.x < 0) return;
if(p.y > self.bounds.size.height || p.y < 0) return;

int column = p.x / 46, row = p.y / 44;
Expand Down