Permalink
Browse files

Merge pull request #2302 from ahankinson/fix-cpview-formatting

Formatting: CPView
2 parents 969d1df + 5736d2c commit c2b7cc7964f368e6994bdd8e5229e02a137ee570 @mrcarlberg mrcarlberg committed on GitHub Oct 13, 2016
Showing with 16 additions and 14 deletions.
  1. +16 −14 AppKit/CPView.j
View
@@ -416,7 +416,7 @@ var CPViewHighDPIDrawingEnabled = YES;
*/
- (void)setToolTip:(CPString)aToolTip
{
- if (_toolTip == aToolTip)
+ if (_toolTip === aToolTip)
return;
if (aToolTip && ![aToolTip isKindOfClass:CPString])
@@ -574,7 +574,7 @@ var CPViewHighDPIDrawingEnabled = YES;
[[self window] _dirtyKeyViewLoop];
// If this is already one of our subviews, remove it.
- if (aSubview._superview == self)
+ if (aSubview._superview === self)
{
var index = [_subviews indexOfObjectIdenticalTo:aSubview];
@@ -863,7 +863,7 @@ var CPViewHighDPIDrawingEnabled = YES;
do
{
- if (view == aView)
+ if (view === aView)
return YES;
} while(view = [view superview])
@@ -978,7 +978,7 @@ var CPViewHighDPIDrawingEnabled = YES;
- (CPView)viewWithTag:(CPInteger)aTag
{
- if ([self tag] == aTag)
+ if ([self tag] === aTag)
return self;
var index = 0,
@@ -1430,7 +1430,7 @@ var CPViewHighDPIDrawingEnabled = YES;
{
var mask = [self autoresizingMask];
- if (mask == CPViewNotSizable)
+ if (mask === CPViewNotSizable)
return;
var frame = _superview._frame,
@@ -1611,7 +1611,7 @@ var CPViewHighDPIDrawingEnabled = YES;
{
do
{
- if (self == view)
+ if (self === view)
{
[_window makeFirstResponder:[self nextValidKeyView]];
break;
@@ -1737,7 +1737,7 @@ var CPViewHighDPIDrawingEnabled = YES;
*/
- (void)setAlphaValue:(float)anAlphaValue
{
- if (_opacity == anAlphaValue)
+ if (_opacity === anAlphaValue)
return;
_opacity = anAlphaValue;
@@ -1936,10 +1936,10 @@ var CPViewHighDPIDrawingEnabled = YES;
*/
- (void)setBackgroundColor:(CPColor)aColor
{
- if (_backgroundColor == aColor)
+ if (_backgroundColor === aColor)
return;
- if (aColor == [CPNull null])
+ if (aColor === [CPNull null])
aColor = nil;
_backgroundColor = aColor;
@@ -1982,7 +1982,7 @@ var CPViewHighDPIDrawingEnabled = YES;
var image = slices[i],
size = [image size];
- if (!size || (size.width == 0 && size.height == 0))
+ if (!size || (size.width === 0 && size.height === 0))
size = nil;
_DOMImageSizes[i] = size;
@@ -2037,10 +2037,12 @@ var CPViewHighDPIDrawingEnabled = YES;
CPDOMDisplayServerSetStyleSize(_DOMImageParts[0], size.width, size.height);
}
else
+ {
_DOMElement.style.background = colorCSS;
if (patternImage)
CPDOMDisplayServerSetStyleBackgroundSize(_DOMElement, [patternImage size].width + "px", [patternImage size].height + "px");
+ }
}
else
{
@@ -2074,7 +2076,7 @@ var CPViewHighDPIDrawingEnabled = YES;
partIndex++;
}
- if (_backgroundType == BackgroundNinePartImage)
+ if (_backgroundType === BackgroundNinePartImage)
{
var left = _DOMImageSizes[0] ? _DOMImageSizes[0].width : 0,
right = _DOMImageSizes[2] ? _DOMImageSizes[2].width : 0,
@@ -2135,7 +2137,7 @@ var CPViewHighDPIDrawingEnabled = YES;
CPDOMDisplayServerSetStyleRightBottom(_DOMImageParts[partIndex], NULL, 0.0, 0.0);
}
}
- else if (_backgroundType == BackgroundVerticalThreePartImage)
+ else if (_backgroundType === BackgroundVerticalThreePartImage)
{
var top = _DOMImageSizes[0] ? _DOMImageSizes[0].height : 0,
bottom = _DOMImageSizes[2] ? _DOMImageSizes[2].height : 0;
@@ -2167,7 +2169,7 @@ var CPViewHighDPIDrawingEnabled = YES;
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], frameSize.width, bottom);
}
}
- else if (_backgroundType == BackgroundHorizontalThreePartImage)
+ else if (_backgroundType === BackgroundHorizontalThreePartImage)
{
var left = _DOMImageSizes[0] ? _DOMImageSizes[0].width : 0,
right = _DOMImageSizes[2] ? _DOMImageSizes[2].width : 0;
@@ -3129,7 +3131,7 @@ setBoundsOrigin:
*/
- (void)setLayer:(CALayer)aLayer
{
- if (_layer == aLayer)
+ if (_layer === aLayer)
return;
if (_layer)

0 comments on commit c2b7cc7

Please sign in to comment.