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

Don't cache dpScale in Utils #1915

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Changes from all commits
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
6 changes: 1 addition & 5 deletions lottie/src/main/java/com/airbnb/lottie/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ protected float[] initialValue() {
};

private static final float INV_SQRT_2 = (float) (Math.sqrt(2) / 2.0);
private static float dpScale = -1;

private Utils() {
}
Expand Down Expand Up @@ -249,10 +248,7 @@ public static int hashFor(float a, float b, float c, float d) {
}

public static float dpScale() {
if (dpScale == -1) {
dpScale = Resources.getSystem().getDisplayMetrics().density;
}
return dpScale;
return Resources.getSystem().getDisplayMetrics().density;
}

public static float getAnimationScale(Context context) {
Expand Down