Skip to content

Commit

Permalink
Don't recalculate the message height if the width hasn't changed
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Jun 17, 2021
1 parent a8ad5d5 commit a05c281
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions IRCCloud/Classes/MainViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
NSString *_msgid;
UIView *_leftBorder, *_rightBorder;
NSTimer *_handoffTimer;
CGFloat _previousWidth;
}
@property (nonatomic) int cidToOpen;
@property (nonatomic) int bidToOpen;
Expand Down
6 changes: 4 additions & 2 deletions IRCCloud/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3320,8 +3320,9 @@ -(void)transitionToSize:(CGSize)size {

[self.view layoutIfNeeded];

//Re-calculate the expanding text view height for the new layout
_message.text = _message.text;
//Re-calculate the expanding text view height for the new layout width
if(_previousWidth != size.width)
_message.text = _message.text;

UIView *v = self.navigationItem.titleView;
self.navigationItem.titleView = nil;
Expand All @@ -3333,6 +3334,7 @@ -(void)transitionToSize:(CGSize)size {

_ignoreInsetChanges = NO;
[self _updateEventsInsets];
_previousWidth = size.width;
}

-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
170
171

0 comments on commit a05c281

Please sign in to comment.