From 773cfc9fe369c16d5b47aa14260b8a5d172faac0 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Thu, 2 Dec 2010 07:23:34 -0500 Subject: [PATCH] Fix the automatic scrolling - UIKit no longer likes 0-height rects :(. Only auto-scroll if we're within 20pt of the bottom of the output, so the user can scroll back in the middle of an operation. --- MobileCydia.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 5c12b8b1..196b9c02 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4674,8 +4674,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) _addProgressOutput:(NSString *)output { [output_ setText:[NSString stringWithFormat:@"%@\n%@", [output_ text], output]]; CGSize size = [output_ contentSize]; - CGRect rect = {{0, size.height}, {size.width, 0}}; - [output_ scrollRectToVisible:rect animated:YES]; + CGPoint offset = [output_ contentOffset]; + if (size.height - offset.y < [output_ frame].size.height + 20.f) { + CGRect rect = {{0, size.height-1}, {size.width, 1}}; + [output_ scrollRectToVisible:rect animated:YES]; + } } - (BOOL) isRunning { -- 2.45.2