Permalink
Browse files

Ooops. Don't wanna overflow Quartz's coordinates.

  • Loading branch information...
1 parent d3bb0c9 commit 3841e42e1ded637ace3494a763870cae8c3ec5ff @uliwitness committed Mar 14, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 UKSyntaxColoredTextViewController.m
@@ -436,6 +436,8 @@ -(void) goToLine: (int)lineNum
Makes the view so wide that text won't wrap anymore.
-------------------------------------------------------------------------- */
+#define REALLY_LARGE_NUMBER 1.0e7 // FLT_MAX is too large and causes our rect to be shortened again.
+
-(void) turnOffWrapping
{
NSTextContainer* textContainer = [TEXTVIEW textContainer];
@@ -446,15 +448,15 @@ -(void) turnOffWrapping
[scrollView setHasHorizontalScroller: YES];
// Make text container so wide it won't wrap:
- [textContainer setContainerSize: NSMakeSize(FLT_MAX, FLT_MAX)];
+ [textContainer setContainerSize: NSMakeSize(REALLY_LARGE_NUMBER, REALLY_LARGE_NUMBER)];
[textContainer setWidthTracksTextView: NO];
[textContainer setHeightTracksTextView: NO];
// Make sure text view is wide enough:
frame.origin = NSMakePoint( 0.0, 0.0 );
frame.size = [scrollView contentSize];
- [TEXTVIEW setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
+ [TEXTVIEW setMaxSize: NSMakeSize(REALLY_LARGE_NUMBER, REALLY_LARGE_NUMBER)];
[TEXTVIEW setHorizontallyResizable: YES];
[TEXTVIEW setVerticallyResizable: YES];
[TEXTVIEW setAutoresizingMask: NSViewNotSizable];

0 comments on commit 3841e42

Please sign in to comment.