Skip to content

Commit

Permalink
Simplify ImageResizeMode.toTileMode
Browse files Browse the repository at this point in the history
  • Loading branch information
motiz88 committed Mar 12, 2018
1 parent b289229 commit 17a8e17
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,10 @@ public static ScalingUtils.ScaleType toScaleType(@Nullable String resizeModeValu
* See {@code ImageResizeMode.js}.
*/
public static Shader.TileMode toTileMode(@Nullable String resizeModeValue) {
if ("contain".equals(resizeModeValue)) {
return Shader.TileMode.CLAMP;
}
if ("cover".equals(resizeModeValue)) {
return Shader.TileMode.CLAMP;
}
if ("stretch".equals(resizeModeValue)) {
return Shader.TileMode.CLAMP;
}
if ("center".equals(resizeModeValue)) {
if ("contain".equals(resizeModeValue)
|| "cover".equals(resizeModeValue)
|| "stretch".equals(resizeModeValue)
|| "center".equals(resizeModeValue)) {
return Shader.TileMode.CLAMP;
}
if ("repeat".equals(resizeModeValue)) {
Expand Down

0 comments on commit 17a8e17

Please sign in to comment.