This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/components/views/messages Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,16 @@ export default class MStickerBody extends MImageBody {
107
107
placeholderFixupHeight = content . info . h + 'px' ;
108
108
}
109
109
110
+ // The pixel size of sticker images is generally larger than their intended display
111
+ // size so they render at native reolution on HiDPI displays. We therefore need to
112
+ // explicity set the size so they render at the intended size.
113
+ // XXX: This will be clobberred when we run fixupHeight(), but we need to do it
114
+ // here otherwise the stickers are momentarily displayed at the pixel size.
115
+ const imageStyle = {
116
+ height : content . info . h ,
117
+ // leave the browser the calculate the width automatically
118
+ } ;
119
+
110
120
placeholderSize = placeholderSize + 'px' ;
111
121
112
122
// Body 'ref' required by MImageBody
@@ -132,6 +142,7 @@ export default class MStickerBody extends MImageBody {
132
142
< img
133
143
className = { 'mx_MStickerBody_image ' + this . state . imageClasses }
134
144
src = { contentUrl }
145
+ style = { imageStyle }
135
146
ref = 'image'
136
147
alt = { content . body }
137
148
onLoad = { this . _onImageLoad }
You can’t perform that action at this time.
0 commit comments