-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an option to clip text if it goes beyond the Y bounds of paragrap…
- Loading branch information
Showing
10 changed files
with
107 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...s/src/androidTest/java/com/airbnb/lottie/snapshots/tests/ClipTextToBoundingBoxTestCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.airbnb.lottie.snapshots.tests | ||
|
||
import com.airbnb.lottie.snapshots.SnapshotTestCase | ||
import com.airbnb.lottie.snapshots.SnapshotTestCaseContext | ||
import com.airbnb.lottie.snapshots.withFilmStripView | ||
|
||
class ClipTextToBoundingBoxTestCase : SnapshotTestCase { | ||
override suspend fun SnapshotTestCaseContext.run() { | ||
withFilmStripView( | ||
"Tests/SzGlyph.json", | ||
"Clip glyph text to bounding box", | ||
"Enabled" | ||
) { filmStripView -> | ||
filmStripView.setClipTextToBoundingBox(true) | ||
} | ||
withFilmStripView( | ||
"Tests/SzGlyph.json", | ||
"Clip glyph text to bounding box", | ||
"Disabled" | ||
) { filmStripView -> | ||
filmStripView.setClipTextToBoundingBox(false) | ||
} | ||
|
||
withFilmStripView( | ||
"Tests/SzFont.json", | ||
"Clip font text to bounding box", | ||
"Enabled" | ||
) { filmStripView -> | ||
filmStripView.setClipTextToBoundingBox(true) | ||
} | ||
withFilmStripView( | ||
"Tests/SzFont.json", | ||
"Clip font text to bounding box", | ||
"Disabled" | ||
) { filmStripView -> | ||
filmStripView.setClipTextToBoundingBox(false) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"v":"5.12.1","fr":60,"ip":0,"op":60,"w":400,"h":400,"nm":"Comp 1","ddd":0,"assets":[],"fonts":{"list":[{"origin":0,"fPath":"","fClass":"","fFamily":"Helvetica","fWeight":"","fStyle":"Regular","fName":"Helvetica","ascent":72.8994140625}]},"layers":[{"ddd":0,"ind":1,"ty":5,"nm":"1 test test 2 test test 3 test test 4 test test 5 test test","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[198,252,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"t":{"d":{"k":[{"s":{"sz":[280,218],"ps":[-140,-138],"s":48,"f":"Helvetica","t":"1 test test\u00032 test test\u00033 test test\u00034 test test\u00035 test test","ca":0,"j":2,"tr":0,"lh":48,"ls":0,"fc":[0,0,0],"sc":[1,0,0],"sw":1,"of":true},"t":0}]},"p":{},"m":{"g":1,"a":{"a":0,"k":[0,0],"ix":2}},"a":[]},"ip":0,"op":60,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[206,226,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[83.632,89.231,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[294.844,243.43],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0,0,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-8.279,-24.092],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[87.802,91.523],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"ct":1,"bm":0}],"markers":[],"props":{}} |
Oops, something went wrong.