fix bug: constraint size not updated for frontsizeadjuster

This commit is contained in:
Luke Zhao
2016-01-27 13:49:00 -08:00
parent f696eb7476
commit 733c65d1eb
3 changed files with 4 additions and 4 deletions

View File

@@ -125,11 +125,12 @@ static NSCharacterSet *_defaultAvoidTruncationCharacterSet()
_sizeIsCalculated = NO;
_constrainedSize = constrainedSize;
// If the context isn't created yet, it will be initialized with the appropriate size when next accessed.
if (_context) {
if (_context || _fontSizeAdjuster) {
// If we're updating an existing context, make sure to use the same inset logic used during initialization.
// This codepath allows us to reuse the
CGSize shadowConstrainedSize = [[self shadower] insetSizeWithConstrainedSize:constrainedSize];
_context.constrainedSize = shadowConstrainedSize;
if (_context) _context.constrainedSize = shadowConstrainedSize;
if (_fontSizeAdjuster) _fontSizeAdjuster.constrainedSize = shadowConstrainedSize;
}
}
}