diff --git a/ChangeLog b/ChangeLog index 3e66e6dd1..f5f3610f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,18 @@ * Headers/AppKit/AppKit.h: Add NSColorSpace.h. This fixes bug #34913. +2011-11-28 Gregory Casamento + + * Source/NSTextView.m: Add code to set the default + of 5.0 in the -buildUpTextNetwork method. + * Source/NSTextContainer.m: In -lineFragmentForProposedRect:... + add _lineFragmentPadding to min and subtract from max to + shift the line fragment rectangle. + * Source/NSLayoutManager.m: In -insertionPointRectForCharacterIndex:.. + add the padding to the initial position of the insertion point + so that before there is anything in the text container, the cursor + is sitting at the correct position. + 2011-11-25 20:27 theraven * libs/gui/trunk/Headers/AppKit/NSApplication.h: NSAutoreleasePool* diff --git a/Source/NSLayoutManager.m b/Source/NSLayoutManager.m index b2e1f99b7..43b1a9b53 100644 --- a/Source/NSLayoutManager.m +++ b/Source/NSLayoutManager.m @@ -956,6 +956,11 @@ has the same y origin and height as the line frag rect it is in. if (i == -1 || textcontainers[i].textContainer != textContainer) return NSZeroRect; + if(cindex == 0) + { + r.origin.x += [textContainer lineFragmentPadding]; + } + return r; } diff --git a/Source/NSTextContainer.m b/Source/NSTextContainer.m index f7baecc00..46c7e048b 100644 --- a/Source/NSTextContainer.m +++ b/Source/NSTextContainer.m @@ -107,7 +107,7 @@ use bounds rectangle instead of frame? */ _layoutManager = nil; _textView = nil; _containerRect.size = aSize; - _lineFragmentPadding = 0.0; + _lineFragmentPadding = 0.0; _observingFrameChanges = NO; _widthTracksTextView = NO; _heightTracksTextView = NO; @@ -364,8 +364,8 @@ framework intact. miny = NSMinY(proposedRect); maxy = NSMaxY(proposedRect); - cminx = NSMinX(_containerRect); - cmaxx = NSMaxX(_containerRect); + cminx = NSMinX(_containerRect) + _lineFragmentPadding; + cmaxx = NSMaxX(_containerRect) - _lineFragmentPadding; cminy = NSMinY(_containerRect); cmaxy = NSMaxY(_containerRect); diff --git a/Source/NSTextView.m b/Source/NSTextView.m index 3b666c577..08a5c8d38 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -697,6 +697,7 @@ If a text view is added to an empty text network, it keeps its attributes. RELEASE(layoutManager); textContainer = [[NSTextContainer alloc] initWithContainerSize: aSize]; + [textContainer setLineFragmentPadding: 5.0]; // Tests on Cocoa indicate the default value is 5. [layoutManager addTextContainer: textContainer]; RELEASE(textContainer);