Permalink
Browse files

Bugfix for unwanted scroll animation on newer Macs when web preview i…

…s scrolled to bottom.
  • Loading branch information...
1 parent 506db84 commit 99123324ac04b6f13db051106d771473668823db @nfarina nfarina committed Dec 23, 2010
Showing with 1 addition and 5 deletions.
  1. +1 −5 MyDocument.m
View
@@ -10,10 +10,6 @@
NSString *kMarkdownDocumentType = @"MarkdownDocumentType";
-@interface NSResponder (scrollToEndOfDocument)
-- (IBAction)scrollToEndOfDocument:(id)sender; // For some reason this isn't declared anywhere in AppKit.
-@end
-
@implementation MyDocument
- (NSString*)markdown2html:(NSString*)markdown_ {
@@ -122,7 +118,7 @@ - (void)webView:(WebView*)sender_ didFinishLoadForFrame:(WebFrame*)frame_ {
if ([htmlPreviewWebView mainFrame] == frame_ && hasSavedOrigin) {
hasSavedOrigin = NO;
if (savedAtBottom)
- [[frame_ frameView] scrollToEndOfDocument:nil];
+ [[[frame_ frameView] documentView] scrollPoint:NSMakePoint(savedOrigin.x, CGFLOAT_MAX)];
else
[[[frame_ frameView] documentView] scrollPoint:savedOrigin];
}

0 comments on commit 9912332

Please sign in to comment.