Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed: Using Text Delegate and scaletype then the textfield wont posi… #1583

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed: Using Text Delegate and scaletype then the textfield wont posi…
…tion correctly #1310
  • Loading branch information
鲤庭 committed Jun 20, 2020
commit f1ca063efe1ef119b0be3a55255272584c49aefe
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void getBounds(RectF outBounds, Matrix parentMatrix, boolean applyParents
void drawLayer(Canvas canvas, Matrix parentMatrix, int parentAlpha) {
canvas.save();
if (!lottieDrawable.useTextGlyphs()) {
canvas.setMatrix(parentMatrix);
canvas.concat(parentMatrix);
}
DocumentData documentData = textAnimation.getValue();
Font font = composition.getFonts().get(documentData.fontName);
Expand Down Expand Up @@ -231,6 +231,8 @@ private void drawTextWithFont(
String textLine = textLines.get(l);
float textLineWidth = strokePaint.measureText(textLine);

canvas.save();

// Apply horizontal justification
applyJustification(documentData.justification, canvas, textLineWidth);

Expand All @@ -243,7 +245,8 @@ private void drawTextWithFont(
drawFontTextLine(textLine, documentData, canvas, parentScale);

// Reset canvas
canvas.setMatrix(parentMatrix);
//canvas.setMatrix(parentMatrix);
canvas.restore();
}
}

Expand Down