Skip to content

Commit

Permalink
Fix for toolbar item minsize/maxsize mismatch.
Browse files Browse the repository at this point in the history
[cappuccino#85 state:resolved]

Reviewed by ross.
  • Loading branch information
Francisco Ryan Tolmasky I committed Oct 3, 2008
1 parent 7a69d6e commit cbcd3bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions AppKit/CPToolbarItem.j
Expand Up @@ -313,7 +313,10 @@ var _CPToolbarSeparatorItemView = nil;
*/
- (void)setMinSize:(CGSize)aMinSize
{
_minSize = CGSizeCreateCopy(aMinSize);
_minSize = CGSizeMakeCopy(aMinSize);

// Try to provide some sanity: Make maxSize >= minSize
_maxSize = CGSizeMake(MAX(_minSize.width, _maxSize.width), MAX(_minSize.height, _maxSize.height));
}

/*
Expand All @@ -330,7 +333,10 @@ var _CPToolbarSeparatorItemView = nil;
*/
- (void)setMaxSize:(CGSize)aMaxSize
{
_maxSize = CGSizeCreateCopy(aMaxSize);
_maxSize = CGSizeMakeCopy(aMaxSize);

// Try to provide some sanity: Make minSize <= maxSize
_minSize = CGSizeMake(MIN(_minSize.width, _maxSize.width), MIN(_minSize.height, _maxSize.height));
}

// Visibility Priority
Expand Down

0 comments on commit cbcd3bb

Please sign in to comment.