changeset 1553:46a2123ff570

Cleanup of the previous commits on Mac, don't do more calculations than we need to.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 14 Jan 2012 19:05:56 +0000
parents f00f91d15cbf
children e39e9e67110d
files mac/dw.m
diffstat 1 files changed, 15 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Sat Jan 14 17:30:37 2012 +0000
+++ b/mac/dw.m	Sat Jan 14 19:05:56 2012 +0000
@@ -3543,7 +3543,6 @@
             NSScrollView *sv = [object scrollview];
             NSSize frame = [sv frame].size;
             BOOL hscroll = [sv hasHorizontalScroller];
-            BOOL scrolled = FALSE;
            
             /* Make sure word wrap is off for the first part */
             if(!hscroll)
@@ -3563,26 +3562,25 @@
             {
                 [[object textContainer] setWidthTracksTextView:YES];
                 [sv setHasHorizontalScroller:NO];
-            }
-            /* If the un wrapped it is beyond the bounds... */
-            if(size.width > _DW_SCROLLED_MAX_WIDTH)
-            {
-                NSSize max = [object maxSize];
                 
-                /* Set the flag for later */
-                scrolled = TRUE;
-                /* Set the max size to the limit */
-                [object setMaxSize:NSMakeSize(_DW_SCROLLED_MAX_WIDTH, max.height)];
-                /* Recalculate the size */
-                [object sizeToFit];
-                size = [object bounds].size;
-                size.width += 2.0;
-                size.height += 2.0;
-                [object setMaxSize:max];
+                /* If the un wrapped it is beyond the bounds... */
+                if(size.width > _DW_SCROLLED_MAX_WIDTH)
+                {
+                    NSSize max = [object maxSize];
+                    
+                    /* Set the max size to the limit */
+                    [object setMaxSize:NSMakeSize(_DW_SCROLLED_MAX_WIDTH, max.height)];
+                    /* Recalculate the size */
+                    [object sizeToFit];
+                    size = [object bounds].size;
+                    size.width += 2.0;
+                    size.height += 2.0;
+                    [object setMaxSize:max];
+                }
             }
             [sv setFrameSize:frame];
             /* Take into account the horizontal scrollbar */
-            if(hscroll && scrolled)
+            if(hscroll && size.width > _DW_SCROLLED_MAX_WIDTH)
                 size.height += 16.0;
         }
         else