Skip to content

Commit e12e0a4

Browse files
afweissmaterial-automation
authored andcommitted
Deleted scaledValueForValue API from Material Typography.
PiperOrigin-RevId: 368416188
1 parent 39911e5 commit e12e0a4

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

components/Typography/src/MDCFontScaler.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,4 @@ UIKIT_EXTERN MDCTextStyle const MDCTextStyleOverline;
7777
*/
7878
- (nonnull UIFont *)scaledFontWithFont:(nonnull UIFont *)font;
7979

80-
/**
81-
Scales an arbitrary value based on the current Dynamic Type settings and the scaling curve.
82-
83-
This method calculates the current scale factor and multiplies it by the given value.
84-
85-
As an example, assume the metrics value for @c .Large is 12 and the current @c
86-
UIContentCategorySize is
87-
@c .ExtraLarge with a metrics value of 24. When passed a @c value of 10, expect a return
88-
value of 20.
89-
90-
@param value The original layout value.
91-
@return A value that has been scaled based on the attached scaling curve
92-
*/
93-
- (CGFloat)scaledValueForValue:(CGFloat)value;
94-
9580
@end

components/Typography/src/MDCFontScaler.m

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -280,30 +280,6 @@ - (UIFont *)scaledFontWithFont:(UIFont *)font {
280280
return scaledFont;
281281
}
282282

283-
- (CGFloat)scaledValueForValue:(CGFloat)value {
284-
UIContentSizeCategory defaultSizeCategory = UIContentSizeCategoryLarge;
285-
// If it is available, query the preferredContentSizeCategory.
286-
UIContentSizeCategory currentSizeCategory = GetCurrentSizeCategory();
287-
288-
NSNumber *defaultFontSizeNumber = _scalingCurve[defaultSizeCategory];
289-
NSNumber *currentFontSizeNumber = _scalingCurve[currentSizeCategory];
290-
291-
// Guard against broken / incomplete scaling curves by returning self if fontSizeNumber is nil.
292-
if (currentFontSizeNumber == nil || defaultFontSizeNumber == nil) {
293-
return value;
294-
}
295-
296-
CGFloat currentFontSize = (CGFloat)currentFontSizeNumber.doubleValue;
297-
CGFloat defaultFontSize = (CGFloat)defaultFontSizeNumber.doubleValue;
298-
299-
// Guard against broken / incomplete scaling curves by returning self if fontSize <= 0.0.
300-
if (currentFontSize <= 0.0 || defaultFontSize <= 0.0) {
301-
return value;
302-
}
303-
304-
return (currentFontSize / defaultFontSize) * value;
305-
}
306-
307283
- (NSString *)description {
308284
NSString *superDescription = [super description];
309285
NSString *styleDescription = @"No Attached Style";

0 commit comments

Comments
 (0)