• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

TextMate is a graphical text editor for OS X 10.7+


Commit MetaInfo

Revision7b4bf9c8930252d0bc1ad6ec47965005cd57a5a3 (tree)
Time2012-08-22 21:34:25
AuthorAllan Odgaard <git@abet...>
CommiterAllan Odgaard

Log Message

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.

Change Summary

Incremental Difference

--- a/Frameworks/OakTextView/src/OakDocumentView.mm
+++ b/Frameworks/OakTextView/src/OakDocumentView.mm
@@ -89,7 +89,7 @@ private:
8989
9090 CGFloat gutterViewWidth = 40;
9191
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);
9393 NSSize textViewSize = [NSScrollView contentSizeForFrameSize:textScrollViewFrame.size hasHorizontalScroller:YES hasVerticalScroller:YES borderType:NSNoBorder];
9494
9595 textScrollView = [[NSScrollView alloc] initWithFrame:textScrollViewFrame];
@@ -104,7 +104,7 @@ private:
104104
105105 [self addSubview:textScrollView];
106106
107- NSRect gutterScrollViewFrame = NSMakeRect(0, OakStatusBarHeight, gutterViewWidth, NSHeight(aRect)-OakStatusBarHeight);
107+ NSRect gutterScrollViewFrame = NSMakeRect(0, OakStatusBarHeight, gutterViewWidth - 1, NSHeight(aRect)-OakStatusBarHeight);
108108 NSSize gutterViewSize = [NSScrollView contentSizeForFrameSize:gutterScrollViewFrame.size hasHorizontalScroller:NO hasVerticalScroller:NO borderType:NSNoBorder];
109109
110110 gutterView = [[GutterView alloc] initWithFrame:NSMakeRect(0, 0, gutterViewSize.width, gutterViewSize.height)];
@@ -333,7 +333,7 @@ private:
333333
334334 CGFloat totalHeight = NSHeight(self.frame);
335335 CGFloat docHeight = totalHeight - NSHeight(statusBar.frame) - topHeight - bottomHeight;
336- CGFloat gutterWidth = NSWidth(gutterScrollView.frame);
336+ CGFloat gutterWidth = NSWidth(gutterScrollView.frame) + 1;
337337
338338 CGFloat y = NSHeight(statusBar.frame);
339339 for(NSView* view in bottomAuxiliaryViews)
@@ -342,7 +342,7 @@ private:
342342 y += NSHeight(view.frame);
343343 }
344344
345- [gutterScrollView setFrame:NSMakeRect(0, y, gutterWidth, docHeight)];
345+ [gutterScrollView setFrame:NSMakeRect(0, y, gutterWidth - 1, docHeight)];
346346 [textScrollView setFrame:NSMakeRect(gutterWidth, y, NSWidth(textScrollView.frame), docHeight)];
347347
348348 y += docHeight;
@@ -401,11 +401,11 @@ private:
401401 [[NSColor grayColor] set];
402402 NSRectFill(NSIntersectionRect(NSMakeRect(NSMinX(aRect), NSHeight(self.frame) - height, NSWidth(aRect), 1), aRect));
403403 }
404-
404+
405405 // Draw the border between gutter and text views
406406 [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)));
409409 }
410410
411411 // ======================