Use text size variable
diff --git a/lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java b/lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java
index 08d3904..ff1790c 100644
--- a/lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java
+++ b/lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java
@@ -136,7 +136,7 @@
strokePaint.setStrokeWidth(strokeWidthAnimation.getValue());
} else {
float parentScale = Utils.getScale(parentMatrix);
- strokePaint.setStrokeWidth((float) (documentData.strokeWidth * Utils.dpScale() * parentScale));
+ strokePaint.setStrokeWidth(documentData.strokeWidth * Utils.dpScale() * parentScale);
}
if (lottieDrawable.useTextGlyphs()) {
@@ -150,13 +150,13 @@
private void drawTextGlyphs(
DocumentData documentData, Matrix parentMatrix, Font font, Canvas canvas) {
- float fontScale = (float) documentData.size / 100f;
+ float fontScale = documentData.size / 100f;
float parentScale = Utils.getScale(parentMatrix);
String text = documentData.text;
// Line height
- float lineHeight = (float) documentData.lineHeight * Utils.dpScale();
+ float lineHeight = documentData.lineHeight * Utils.dpScale();
// Split full text in multiple lines
List<String> textLines = getTextLines(text);
@@ -219,13 +219,13 @@
text = textDelegate.getTextInternal(text);
}
fillPaint.setTypeface(typeface);
- double textSize = textSizeAnimation == null ? documentData.size : textSizeAnimation.getValue();
- fillPaint.setTextSize((float) (documentData.size * Utils.dpScale()));
+ float textSize = textSizeAnimation == null ? documentData.size : textSizeAnimation.getValue();
+ fillPaint.setTextSize(textSize * Utils.dpScale());
strokePaint.setTypeface(fillPaint.getTypeface());
strokePaint.setTextSize(fillPaint.getTextSize());
// Line height
- float lineHeight = (float) documentData.lineHeight * Utils.dpScale();
+ float lineHeight = documentData.lineHeight * Utils.dpScale();
// Split full text in multiple lines
List<String> textLines = getTextLines(text);
@@ -315,7 +315,7 @@
Path path = contentGroups.get(j).getPath();
path.computeBounds(rectF, false);
matrix.set(parentMatrix);
- matrix.preTranslate(0, (float) -documentData.baselineShift * Utils.dpScale());
+ matrix.preTranslate(0, -documentData.baselineShift * Utils.dpScale());
matrix.preScale(fontScale, fontScale);
path.transform(matrix);
if (documentData.strokeOverFill) {