use of com.airbnb.lottie.animation.content.ContentGroup in project lottie-android by airbnb.
the class TextLayer method getContentsForCharacter.
private List<ContentGroup> getContentsForCharacter(FontCharacter character) {
if (contentsForCharacter.containsKey(character)) {
return contentsForCharacter.get(character);
}
List<ShapeGroup> shapes = character.getShapes();
int size = shapes.size();
List<ContentGroup> contents = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
ShapeGroup sg = shapes.get(i);
contents.add(new ContentGroup(lottieDrawable, this, sg));
}
contentsForCharacter.put(character, contents);
return contents;
}
use of com.airbnb.lottie.animation.content.ContentGroup in project lottie-android by airbnb.
the class TextLayer method drawCharacterAsGlyph.
private void drawCharacterAsGlyph(FontCharacter character, Matrix parentMatrix, float fontScale, DocumentData documentData, Canvas canvas) {
List<ContentGroup> contentGroups = getContentsForCharacter(character);
for (int j = 0; j < contentGroups.size(); j++) {
Path path = contentGroups.get(j).getPath();
path.computeBounds(rectF, false);
matrix.set(parentMatrix);
matrix.preTranslate(0, -documentData.baselineShift * Utils.dpScale());
matrix.preScale(fontScale, fontScale);
path.transform(matrix);
if (documentData.strokeOverFill) {
drawGlyph(path, fillPaint, canvas);
drawGlyph(path, strokePaint, canvas);
} else {
drawGlyph(path, strokePaint, canvas);
drawGlyph(path, fillPaint, canvas);
}
}
}
Aggregations