1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Scale downloaded images

This commit is contained in:
M66B 2019-05-03 18:06:58 +02:00
parent 4cac61b03b
commit 9bb6bd0378

View file

@ -434,9 +434,21 @@ public class HtmlHelper {
handler.post(new Runnable() {
@Override
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.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
lld.setBounds(0, 0, w, h);
lld.setLevel(1);
view.setText(view.getText());
}
});