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:
parent
4cac61b03b
commit
9bb6bd0378
1 changed files with 13 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue