TextMate is a graphical text editor for OS X 10.7+
Revision | 7b4bf9c8930252d0bc1ad6ec47965005cd57a5a3 (tree) |
---|---|
Time | 2012-08-22 21:34:25 |
Author | Allan Odgaard <git@abet...> |
Commiter | Allan Odgaard |
fixup! Move border drawing to OakDocumentView
Drawing the border did not account for auxiliary views (presently used by incremental search). See issue #240.
It also did not properly layout the views when adding/removing such views, causing the border to disappear after having used incremental search.
@@ -89,7 +89,7 @@ private: | ||
89 | 89 | |
90 | 90 | CGFloat gutterViewWidth = 40; |
91 | 91 | |
92 | - NSRect textScrollViewFrame = NSMakeRect(gutterViewWidth+1, OakStatusBarHeight, NSWidth(aRect)-gutterViewWidth-1, NSHeight(aRect)-OakStatusBarHeight); | |
92 | + NSRect textScrollViewFrame = NSMakeRect(gutterViewWidth, OakStatusBarHeight, NSWidth(aRect)-gutterViewWidth, NSHeight(aRect)-OakStatusBarHeight); | |
93 | 93 | NSSize textViewSize = [NSScrollView contentSizeForFrameSize:textScrollViewFrame.size hasHorizontalScroller:YES hasVerticalScroller:YES borderType:NSNoBorder]; |
94 | 94 | |
95 | 95 | textScrollView = [[NSScrollView alloc] initWithFrame:textScrollViewFrame]; |
@@ -104,7 +104,7 @@ private: | ||
104 | 104 | |
105 | 105 | [self addSubview:textScrollView]; |
106 | 106 | |
107 | - NSRect gutterScrollViewFrame = NSMakeRect(0, OakStatusBarHeight, gutterViewWidth, NSHeight(aRect)-OakStatusBarHeight); | |
107 | + NSRect gutterScrollViewFrame = NSMakeRect(0, OakStatusBarHeight, gutterViewWidth - 1, NSHeight(aRect)-OakStatusBarHeight); | |
108 | 108 | NSSize gutterViewSize = [NSScrollView contentSizeForFrameSize:gutterScrollViewFrame.size hasHorizontalScroller:NO hasVerticalScroller:NO borderType:NSNoBorder]; |
109 | 109 | |
110 | 110 | gutterView = [[GutterView alloc] initWithFrame:NSMakeRect(0, 0, gutterViewSize.width, gutterViewSize.height)]; |
@@ -333,7 +333,7 @@ private: | ||
333 | 333 | |
334 | 334 | CGFloat totalHeight = NSHeight(self.frame); |
335 | 335 | CGFloat docHeight = totalHeight - NSHeight(statusBar.frame) - topHeight - bottomHeight; |
336 | - CGFloat gutterWidth = NSWidth(gutterScrollView.frame); | |
336 | + CGFloat gutterWidth = NSWidth(gutterScrollView.frame) + 1; | |
337 | 337 | |
338 | 338 | CGFloat y = NSHeight(statusBar.frame); |
339 | 339 | for(NSView* view in bottomAuxiliaryViews) |
@@ -342,7 +342,7 @@ private: | ||
342 | 342 | y += NSHeight(view.frame); |
343 | 343 | } |
344 | 344 | |
345 | - [gutterScrollView setFrame:NSMakeRect(0, y, gutterWidth, docHeight)]; | |
345 | + [gutterScrollView setFrame:NSMakeRect(0, y, gutterWidth - 1, docHeight)]; | |
346 | 346 | [textScrollView setFrame:NSMakeRect(gutterWidth, y, NSWidth(textScrollView.frame), docHeight)]; |
347 | 347 | |
348 | 348 | y += docHeight; |
@@ -401,11 +401,11 @@ private: | ||
401 | 401 | [[NSColor grayColor] set]; |
402 | 402 | NSRectFill(NSIntersectionRect(NSMakeRect(NSMinX(aRect), NSHeight(self.frame) - height, NSWidth(aRect), 1), aRect)); |
403 | 403 | } |
404 | - | |
404 | + | |
405 | 405 | // Draw the border between gutter and text views |
406 | 406 | [gutterDividerColor set]; |
407 | - NSRect gutterFrame = gutterView.frame; | |
408 | - NSRectFill(NSMakeRect(NSMaxX(gutterFrame), OakStatusBarHeight, 1, NSHeight(self.frame)-OakStatusBarHeight)); | |
407 | + NSRect gutterFrame = gutterScrollView.frame; | |
408 | + NSRectFill(NSMakeRect(NSMaxX(gutterFrame), NSMinY(gutterFrame), 1, NSHeight(gutterFrame))); | |
409 | 409 | } |
410 | 410 | |
411 | 411 | // ====================== |