mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-07-01 05:53:02 +03:00
refactor: scale avatar to 32x32 before drawing
This commit is contained in:
parent
5266d1190f
commit
ba0e041423
@ -12,6 +12,7 @@ use std::time::{Duration, SystemTime};
|
||||
|
||||
use chrono::Local;
|
||||
|
||||
use gtk4::gdk_pixbuf::InterpType;
|
||||
use gtk4 as gtk;
|
||||
|
||||
use gtk::gdk::{Cursor, Display, Texture};
|
||||
@ -1075,6 +1076,9 @@ fn prepare_avatar(avatars: &mut RwLockWriteGuard<'_, HashMap<u64, Pixbuf>>, mess
|
||||
let Ok(pixbuf) = load_pixbuf(&data.to_vec()) else {
|
||||
return
|
||||
};
|
||||
let Some(pixbuf) = pixbuf.scale_simple(32, 32, InterpType::Bilinear) else {
|
||||
return
|
||||
};
|
||||
avatars.insert(id, pixbuf);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user