From a05c281bc4c365e8b97409c65e6f4525abf2e106 Mon Sep 17 00:00:00 2001 From: Sam Steele Date: Thu, 17 Jun 2021 08:16:28 -0400 Subject: [PATCH] Don't recalculate the message height if the width hasn't changed --- IRCCloud/Classes/MainViewController.h | 1 + IRCCloud/Classes/MainViewController.m | 6 ++++-- build-scripts/BUILD | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/IRCCloud/Classes/MainViewController.h b/IRCCloud/Classes/MainViewController.h index eb86cb85..5144ddb7 100644 --- a/IRCCloud/Classes/MainViewController.h +++ b/IRCCloud/Classes/MainViewController.h @@ -119,6 +119,7 @@ NSString *_msgid; UIView *_leftBorder, *_rightBorder; NSTimer *_handoffTimer; + CGFloat _previousWidth; } @property (nonatomic) int cidToOpen; @property (nonatomic) int bidToOpen; diff --git a/IRCCloud/Classes/MainViewController.m b/IRCCloud/Classes/MainViewController.m index 6402dc9f..5574be72 100644 --- a/IRCCloud/Classes/MainViewController.m +++ b/IRCCloud/Classes/MainViewController.m @@ -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; @@ -3333,6 +3334,7 @@ -(void)transitionToSize:(CGSize)size { _ignoreInsetChanges = NO; [self _updateEventsInsets]; + _previousWidth = size.width; } -(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { diff --git a/build-scripts/BUILD b/build-scripts/BUILD index 3968aef8..6547e415 100644 --- a/build-scripts/BUILD +++ b/build-scripts/BUILD @@ -1 +1 @@ -170 \ No newline at end of file +171 \ No newline at end of file