mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Only throw if ASLayoutElement style width or height are ASDimensionUnitFraction (#2484)
This commit is contained in:
committed by
Adlai Holler
parent
627d146a5a
commit
eb6cf0689d
@@ -257,12 +257,12 @@ do {\
|
||||
- (CGSize)preferredSize
|
||||
{
|
||||
ASDN::MutexLocker l(__instanceLock__);
|
||||
if (_size.width.unit != ASDimensionUnitPoints) {
|
||||
if (_size.width.unit == ASDimensionUnitFraction) {
|
||||
NSCAssert(NO, @"Cannot get preferredSize of element with fractional width. Width: %@.", NSStringFromASDimension(_size.width));
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
||||
if (_size.height.unit != ASDimensionUnitPoints) {
|
||||
if (_size.height.unit == ASDimensionUnitFraction) {
|
||||
NSCAssert(NO, @"Cannot get preferredSize of element with fractional height. Height: %@.", NSStringFromASDimension(_size.height));
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user