Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
gpeal committed Dec 29, 2023
1 parent be7c8dd commit 1449525
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public boolean getClipTextToBoundingBox() {
* that overflows past its height will not be drawn.
*/
public void setClipTextToBoundingBox(boolean clipTextToBoundingBox) {
if (clipTextToBoundingBox != this.clipToCompositionBounds) {
if (clipTextToBoundingBox != this.clipTextToBoundingBox) {
this.clipTextToBoundingBox = clipTextToBoundingBox;
invalidateSelf();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private void drawTextWithGlyphs(

canvas.save();

if (offsetCanvas(canvas, documentData, lineIndex, line.width) || !lottieDrawable.getClipTextToBoundingBox()) {
if (offsetCanvas(canvas, documentData, lineIndex, line.width)) {
drawGlyphTextLine(line.text, documentData, font, canvas, parentScale, fontScale, tracking);
}

Expand Down Expand Up @@ -273,7 +273,7 @@ private void drawTextWithFont(DocumentData documentData, Font font, Canvas canva

canvas.save();

if (offsetCanvas(canvas, documentData, lineIndex, line.width) || !lottieDrawable.getClipTextToBoundingBox()) {
if (offsetCanvas(canvas, documentData, lineIndex, line.width)) {
drawFontTextLine(line.text, documentData, canvas, tracking);
}

Expand All @@ -288,7 +288,7 @@ private boolean offsetCanvas(Canvas canvas, DocumentData documentData, int lineI
float dpScale = Utils.dpScale();
float lineStartY = position == null ? 0f : documentData.lineHeight * dpScale + position.y;
float lineOffset = (lineIndex * documentData.lineHeight * dpScale) + lineStartY;
if (size != null && position != null && lineOffset >= position.y + size.y + documentData.size) {
if (lottieDrawable.getClipTextToBoundingBox() && size != null && position != null && lineOffset >= position.y + size.y + documentData.size) {
return false;
}
float lineStart = position == null ? 0f : position.x;
Expand Down

0 comments on commit 1449525

Please sign in to comment.