mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-21 15:55:02 +00:00
safety checks
This commit is contained in:
1 parent
10fb3e6d31
commit
5fd2f49266
1 file changed
+6
-9
+6
-9
@@ -1475,18 +1475,16 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
}
|
||||
|
||||
[self willChangeValueForKey:@"scaleSize"];
|
||||
if (size.width === 0 || size.height === 0)
|
||||
{
|
||||
_scaleSize = CGSizeMake(1.0, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (size && size.width !== 0 && size.height !== 0 && frameSize)
|
||||
_scaleSize = CGSizeMake(frameSize.width / size.width, frameSize.height / size.height);
|
||||
}
|
||||
else
|
||||
_scaleSize = CGSizeMake(1.0, 1.0);
|
||||
|
||||
_isScaled = (_scaleSize.width !== 1.0 || _scaleSize.height !== 1.0);
|
||||
[self didChangeValueForKey:@"scaleSize"];
|
||||
|
||||
// Recompute hierarchy scale size for this view and its descendants
|
||||
// Recompute hierarchy scale size safely
|
||||
[self _scaleSizeUnitSquareToSize:CGSizeMake(1.0, 1.0)];
|
||||
|
||||
if (_layer)
|
||||
@@ -1502,7 +1500,6 @@ var CPViewHighDPIDrawingEnabled = YES;
|
||||
[self _updateTrackingAreasWithRecursion:YES];
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Notifies subviews that the superview changed size.
|
||||
@param aSize the size of the old superview
|
||||
|
||||
Reference in new issue
Block a user