You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
*Avatar: Calculate thumbnail dimensions based on devicePixelRatio
Multiply the dimension by the device pixel ratio and then round it to get the width/height of the thumbnail to use in the request.
This commit is contained in:
@@ -22,8 +22,8 @@ module.exports = {
|
||||
avatarUrlForMember: function(member, width, height, resizeMethod) {
|
||||
var url = member.getAvatarUrl(
|
||||
MatrixClientPeg.get().getHomeserverUrl(),
|
||||
window.devicePixelRatio > 1.2 ? 96 : width,
|
||||
window.devicePixelRatio > 1.2 ? 96 : height,
|
||||
Math.floor(width * window.devicePixelRatio),
|
||||
Math.floor(height * window.devicePixelRatio),
|
||||
resizeMethod,
|
||||
false,
|
||||
false
|
||||
@@ -40,8 +40,8 @@ module.exports = {
|
||||
avatarUrlForUser: function(user, width, height, resizeMethod) {
|
||||
var url = ContentRepo.getHttpUriForMxc(
|
||||
MatrixClientPeg.get().getHomeserverUrl(), user.avatarUrl,
|
||||
window.devicePixelRatio > 1.2 ? 96 : width,
|
||||
window.devicePixelRatio > 1.2 ? 96 : height,
|
||||
Math.floor(width * window.devicePixelRatio),
|
||||
Math.floor(height * window.devicePixelRatio),
|
||||
resizeMethod
|
||||
);
|
||||
if (!url || url.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user