mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +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() {
|
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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -177,4 +177,8 @@ export class Platform {
|
|||||||
hasReadPixelPermission() {
|
hasReadPixelPermission() {
|
||||||
return hasReadPixelPermission();
|
return hasReadPixelPermission();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get devicePixelRatio() {
|
||||||
|
return window.devicePixelRatio || 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user