refactor: address a comment

This commit is contained in:
Vasil Chimev
2019-10-02 19:01:27 +03:00
parent cb1f7cc182
commit 173665a620

View File

@ -210,8 +210,10 @@ export class TextBase extends TextBaseCommon {
const string = (text === undefined || text === null) ? "" : text.toString(); const string = (text === undefined || text === null) ? "" : text.toString();
const source = getTransformedText(string, this.textTransform); const source = getTransformedText(string, this.textTransform);
if (dict.size > 0 || isTextView) { if (dict.size > 0 || isTextView) {
if (isTextView) {
// UITextView's font seems to change inside. // UITextView's font seems to change inside.
dict.set(NSFontAttributeName, this.nativeTextViewProtected.font); dict.set(NSFontAttributeName, this.nativeTextViewProtected.font);
}
const result = NSMutableAttributedString.alloc().initWithString(source); const result = NSMutableAttributedString.alloc().initWithString(source);
result.setAttributesRange(<any>dict, { location: 0, length: source.length }); result.setAttributesRange(<any>dict, { location: 0, length: source.length });