Skip to content

Commit

Permalink
Merge pull request cappuccino#1436 from aradabaugh/master
Browse files Browse the repository at this point in the history
Fixes CPShadowView shadowViewEnclosingView to use self instead of shadowView
  • Loading branch information
Randy Luecke committed Jan 20, 2012
2 parents b1e4a43 + 6bc3d49 commit d06fccf
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions AppKit/CPShadowView.j
Expand Up @@ -98,20 +98,24 @@ var LIGHT_LEFT_INSET = 3.0,

+ (id)shadowViewEnclosingView:(CPView)aView withWeight:(CPShadowWeight)aWeight
{
var shadowView = [[CPShadowView alloc] initWithFrame:[aView frame]];
[shadowView setWeight:aWeight];

var size = [shadowView frame].size,
width = size.width - [shadowView leftInset] - [shadowView rightInset],
height = size.height - [shadowView topInset] - [shadowView bottomInset],
enclosingView = [aView superview];

[shadowView setHitTests:[aView hitTests]];
[shadowView setAutoresizingMask:[aView autoresizingMask]];
[aView removeFromSuperview];
[shadowView addSubview:aView];
[aView setFrame:CGRectMake([shadowView leftInset], [shadowView topInset], width, height)]
[enclosingView addSubview:shadowView];
var shadowView = [[self alloc] initWithFrame:[aView frame]];

if (shadowView)
{
[shadowView setWeight:aWeight];

var size = [shadowView frame].size,
width = size.width - [shadowView leftInset] - [shadowView rightInset],
height = size.height - [shadowView topInset] - [shadowView bottomInset],
enclosingView = [aView superview];

[shadowView setHitTests:[aView hitTests]];
[shadowView setAutoresizingMask:[aView autoresizingMask]];
[aView removeFromSuperview];
[shadowView addSubview:aView];
[aView setFrame:CGRectMake([shadowView leftInset], [shadowView topInset], width, height)]
[enclosingView addSubview:shadowView];
}

return shadowView;
}
Expand Down

0 comments on commit d06fccf

Please sign in to comment.