Skip to content

Commit

Permalink
Merge pull request #4834 from vishalduggal/timob-15396
Browse files Browse the repository at this point in the history
[TIMOB-15396] Ensure bounds has a zero origin
  • Loading branch information
pec1985 committed Oct 24, 2013
2 parents 8d3836e + 3c31597 commit 27f438e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions iphone/Classes/TiUITableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,17 @@ -(void)prepareForReuse
// This is because the view drawing subsystem takes the cell frame to be the sandbox bounds when drawing views,
// and if its frame is too big... the view system allocates way too much memory/pixels and doesn't appear to let
// them go.

CGRect oldFrame = [[self contentView] frame];
//CGSize cellSize = [self computeCellSize];

[[self contentView] setFrame:CGRectMake(oldFrame.origin.x, oldFrame.origin.y, 0,0)];
CGRect oldBounds = [[self contentView] bounds];
if (!CGPointEqualToPoint(oldBounds.origin,CGPointZero)) {
//TIMOB-15396. Occasionally the bounds have a non zero origin. Why?
[[self contentView] setBounds:CGRectZero];
[[self contentView] setCenter:CGPointZero];

} else {
CGRect oldFrame = [[self contentView] frame];

[[self contentView] setFrame:CGRectMake(oldFrame.origin.x, oldFrame.origin.y, 0,0)];
}
}

- (UIView *)hitTest:(CGPoint) point withEvent:(UIEvent *)event
Expand Down

0 comments on commit 27f438e

Please sign in to comment.