mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 11:05:03 +01:00
add device pixel ratio scaling while at it
This commit is contained in:
parent
1ad8af34d1
commit
6fd10b63e5
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -177,4 +177,8 @@ export class Platform {
|
||||
hasReadPixelPermission() {
|
||||
return hasReadPixelPermission();
|
||||
}
|
||||
|
||||
get devicePixelRatio() {
|
||||
return window.devicePixelRatio || 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user