Need to make sure we don't create text containers with negative dimensions.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27766 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-02-03 15:56:51 +00:00
parent 54195911db
commit 180170e45a
4 changed files with 38 additions and 4 deletions

View file

@ -140,7 +140,10 @@ static NSHelpPanel *_sharedPanel = nil;
NSTextView *v;
NSRect r;
self = [super initWithContentRect: NSMakeRect(100,100,400,500)
/* We have a standard start size.
*/
contentRect = NSMakeRect(100,100,400,500);
self = [super initWithContentRect: contentRect
styleMask: NSTitledWindowMask|NSClosableWindowMask|NSResizableWindowMask
backing: NSBackingStoreBuffered
defer: NO
@ -164,7 +167,7 @@ static NSHelpPanel *_sharedPanel = nil;
[v setMaxSize: NSMakeSize (1E7, 1E7)];
[v setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
[[v textContainer] setContainerSize:
NSMakeSize (r.size.width, 1e7)];
NSMakeSize (MAX(r.size.width, 0.0), 1e7)];
[[v textContainer] setWidthTracksTextView: YES];
[s setDocumentView: v];