mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
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:
parent
a84a2ca96f
commit
e9aaaf4b61
4 changed files with 21 additions and 3 deletions
12
ChangeLog
12
ChangeLog
|
@ -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*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue