mirror of https://github.com/M66B/FairEmail.git
Scale downloaded images
This commit is contained in:
parent
4cac61b03b
commit
9bb6bd0378
|
@ -434,9 +434,21 @@ public class HtmlHelper {
|
||||||
handler.post(new Runnable() {
|
handler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
int w = d.getIntrinsicWidth();
|
||||||
|
int h = d.getIntrinsicHeight();
|
||||||
|
|
||||||
|
float width = view.getWidth();
|
||||||
|
if (w > width) {
|
||||||
|
float scale = width / w;
|
||||||
|
w = Math.round(w * scale);
|
||||||
|
h = Math.round(h * scale);
|
||||||
|
d.setBounds(0, 0, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
lld.addLevel(1, 1, d);
|
lld.addLevel(1, 1, d);
|
||||||
lld.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
|
lld.setBounds(0, 0, w, h);
|
||||||
lld.setLevel(1);
|
lld.setLevel(1);
|
||||||
|
|
||||||
view.setText(view.getText());
|
view.setText(view.getText());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue