Changes to correct bug#34919. NSTextView should now correctly show the padding set in the lineFragmentPadding attribute of NSTextContainer.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34222 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2011-11-28 02:37:58 +00:00
parent a84a2ca96f
commit e9aaaf4b61
4 changed files with 21 additions and 3 deletions

View file

@ -2,6 +2,18 @@
* Headers/AppKit/AppKit.h: Add NSColorSpace.h. This fixes bug #34913.
2011-11-28 Gregory Casamento <greg.casamento@gmail.com>
* 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*

View file

@ -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;
}

View file

@ -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);

View file

@ -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);