Fix blurry avatars

This commit is contained in:
Robin Townsend committed 2022-11-02 23:12:43 -04:00
1 parent db66700595
commit 093bf7c1a1
1 file changed
+3 -1
+3 -1
View File
@@ -309,5 +309,7 @@ export function getAvatarUrl(
): string { ): string {
const width = Math.floor(avatarSize * window.devicePixelRatio); const width = Math.floor(avatarSize * window.devicePixelRatio);
const height = Math.floor(avatarSize * window.devicePixelRatio); const height = Math.floor(avatarSize * window.devicePixelRatio);
return mxcUrl && client.mxcUrlToHttp(mxcUrl, width, height, "crop"); // scale is more suitable for larger sizes
const resizeMethod = avatarSize <= 96 ? "crop" : "scale";
return mxcUrl && client.mxcUrlToHttp(mxcUrl, width, height, resizeMethod)!;
} }