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() { get avatarUrl() {
if (this._room.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; return null;
} }

View file

@ -134,7 +134,8 @@ export class RoomViewModel extends ViewModel {
get avatarUrl() { get avatarUrl() {
if (this._room.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; return null;
} }

View file

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