From 0eac28a74fcfd2ae398ca42f3a2724a34eb22b8e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 1 Nov 2020 13:45:24 -0600 Subject: [PATCH] Fix stats overlay width decreasing each iteration --- Limelight/ViewControllers/StreamFrameViewController.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index 08964011..20e3468b 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -163,6 +163,13 @@ } if (text != nil) { + // We set our bounds to the maximum width in order to work around a bug where + // sizeToFit interacts badly with the UITextView's line breaks, causing the + // width to get smaller and smaller each time as more line breaks are inserted. + [_overlayView setBounds:CGRectMake(self.view.frame.origin.x, + _overlayView.frame.origin.y, + self.view.frame.size.width, + _overlayView.frame.size.height)]; [_overlayView setText:text]; [_overlayView sizeToFit]; [_overlayView setCenter:CGPointMake(self.view.frame.size.width / 2, _overlayView.frame.size.height / 2)];