From a97a3cea5196d811535ca76fe797c97808f24e14 Mon Sep 17 00:00:00 2001 From: Sergey Shpikin Date: Thu, 23 Apr 2020 10:47:08 +0300 Subject: [PATCH] Make avatars in pills occupy the entire space using cropping Signed-off-by: Sergey Shpikin --- src/editor/parts.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/editor/parts.js b/src/editor/parts.js index 747b491a9e..acd27ac219 100644 --- a/src/editor/parts.js +++ b/src/editor/parts.js @@ -252,7 +252,11 @@ class RoomPillPart extends PillPart { setAvatar(node) { let initialLetter = ""; - let avatarUrl = Avatar.avatarUrlForRoom(this._room, 16 * window.devicePixelRatio, 16 * window.devicePixelRatio); + let avatarUrl = Avatar.avatarUrlForRoom( + this._room, + 16 * window.devicePixelRatio, + 16 * window.devicePixelRatio, + "crop"); if (!avatarUrl) { initialLetter = Avatar.getInitialLetter(this._room ? this._room.name : this.resourceId); avatarUrl = `../../${Avatar.defaultAvatarUrlForString(this._room ? this._room.roomId : this.resourceId)}`; @@ -290,7 +294,8 @@ class UserPillPart extends PillPart { let avatarUrl = Avatar.avatarUrlForMember( this._member, 16 * window.devicePixelRatio, - 16 * window.devicePixelRatio); + 16 * window.devicePixelRatio, + "crop"); let initialLetter = ""; if (avatarUrl === defaultAvatarUrl) { // the url from defaultAvatarUrlForString is meant to go in an img element,