Workaround invalid width/heigth specifications (disabled)

This commit is contained in:
M66B 2020-09-19 09:21:15 +02:00
parent a0729d7164
commit 4a09988d66
1 changed files with 3 additions and 2 deletions

View File

@ -502,8 +502,9 @@ class ImageHelper {
a.height = Math.round(a.width * h / (float) w);
if (a.width != 0 && a.height != 0) {
w = Math.round(Helper.dp2pixels(view.getContext(), a.width) * scale);
h = Math.round(Helper.dp2pixels(view.getContext(), a.height) * scale);
boolean swap = ((w > h) != (a.width > a.height)) && false;
w = Math.round(Helper.dp2pixels(view.getContext(), swap ? a.height : a.width) * scale);
h = Math.round(Helper.dp2pixels(view.getContext(), swap ? a.width : a.height) * scale);
}
float width = view.getContext().getResources().getDisplayMetrics().widthPixels;