add device pixel ratio scaling while at it

This commit is contained in:
Bruno Windels 2020-11-12 13:50:32 +01:00
parent 1ad8af34d1
commit 6fd10b63e5
3 changed files with 8 additions and 2 deletions

View File

@ -133,7 +133,8 @@ export class RoomTileViewModel extends ViewModel {
get avatarUrl() {
if (this._room.avatarUrl) {
return this._room.mediaRepository.mxcUrlThumbnail(this._room.avatarUrl, 32, 32, "crop");
const size = 32 * this.platform.devicePixelRatio;
return this._room.mediaRepository.mxcUrlThumbnail(this._room.avatarUrl, size, size, "crop");
}
return null;
}

View File

@ -134,7 +134,8 @@ export class RoomViewModel extends ViewModel {
get avatarUrl() {
if (this._room.avatarUrl) {
return this._room.mediaRepository.mxcUrlThumbnail(this._room.avatarUrl, 32, 32, "crop");
const size = 32 * this.platform.devicePixelRatio;
return this._room.mediaRepository.mxcUrlThumbnail(this._room.avatarUrl, size, size, "crop");
}
return null;
}

View File

@ -177,4 +177,8 @@ export class Platform {
hasReadPixelPermission() {
return hasReadPixelPermission();
}
get devicePixelRatio() {
return window.devicePixelRatio || 1;
}
}