Fix sticker size for scales other than 100
This commit is contained in:
parent
c620c23218
commit
fdb4fa4254
1 changed files with 3 additions and 2 deletions
|
|
@ -59,17 +59,18 @@ bool Sticker::isEmojiSticker() const {
|
|||
|
||||
QSize Sticker::size() {
|
||||
_size = _document->dimensions;
|
||||
const auto maxHeight = int(st::maxStickerSize / 256.0 * StickerHeight());
|
||||
if (isEmojiSticker()) {
|
||||
constexpr auto kIdealStickerSize = 512;
|
||||
const auto zoom = GetEmojiStickerZoom(&_document->session());
|
||||
const auto convert = [&](int size) {
|
||||
return int(size * StickerHeight() * zoom / kIdealStickerSize);
|
||||
return int(size * maxHeight * zoom / kIdealStickerSize);
|
||||
};
|
||||
_size = QSize(convert(_size.width()), convert(_size.height()));
|
||||
} else {
|
||||
_size = DownscaledSize(
|
||||
_size,
|
||||
{ st::maxStickerSize, StickerHeight() });
|
||||
{ st::maxStickerSize, maxHeight });
|
||||
}
|
||||
return _size;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue