add device pixel ratio scaling while at it
This commit is contained in:
parent
1ad8af34d1
commit
6fd10b63e5
3 changed files with 8 additions and 2 deletions
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue