Fix outline of animated sticker sets.

This commit is contained in:
levlam 2022-02-11 18:07:56 +03:00
parent 1b8844b300
commit fc73b94a59
2 changed files with 13 additions and 2 deletions

View File

@ -1962,6 +1962,13 @@ PhotoFormat StickersManager::get_sticker_set_thumbnail_format(StickerFormat stic
}
}
double StickersManager::get_sticker_set_minithumbnail_zoom(const StickerSet *sticker_set) {
if (sticker_set->sticker_format == StickerFormat::Tgs) {
return 100.0 / 512.0;
}
return 1.0;
}
tl_object_ptr<td_api::stickerSet> StickersManager::get_sticker_set_object(StickerSetId sticker_set_id) const {
const StickerSet *sticker_set = get_sticker_set(sticker_set_id);
CHECK(sticker_set != nullptr);
@ -1984,7 +1991,8 @@ tl_object_ptr<td_api::stickerSet> StickersManager::get_sticker_set_object(Sticke
auto thumbnail = get_thumbnail_object(td_->file_manager_.get(), sticker_set->thumbnail, thumbnail_format);
return make_tl_object<td_api::stickerSet>(
sticker_set->id.get(), sticker_set->title, sticker_set->short_name, std::move(thumbnail),
get_sticker_minithumbnail(sticker_set->minithumbnail, sticker_set->id, -2, 1.0),
get_sticker_minithumbnail(sticker_set->minithumbnail, sticker_set->id, -2,
get_sticker_set_minithumbnail_zoom(sticker_set)),
sticker_set->is_installed && !sticker_set->is_archived, sticker_set->is_archived, sticker_set->is_official,
get_sticker_type_object(sticker_set->sticker_format, sticker_set->is_masks, nullptr), sticker_set->is_viewed,
std::move(stickers), std::move(emojis));
@ -2031,7 +2039,8 @@ tl_object_ptr<td_api::stickerSetInfo> StickersManager::get_sticker_set_info_obje
auto thumbnail = get_thumbnail_object(td_->file_manager_.get(), sticker_set->thumbnail, thumbnail_format);
return make_tl_object<td_api::stickerSetInfo>(
sticker_set->id.get(), sticker_set->title, sticker_set->short_name, std::move(thumbnail),
get_sticker_minithumbnail(sticker_set->minithumbnail, sticker_set->id, -3, 1.0),
get_sticker_minithumbnail(sticker_set->minithumbnail, sticker_set->id, -3,
get_sticker_set_minithumbnail_zoom(sticker_set)),
sticker_set->is_installed && !sticker_set->is_archived, sticker_set->is_archived, sticker_set->is_official,
get_sticker_type_object(sticker_set->sticker_format, sticker_set->is_masks, nullptr), sticker_set->is_viewed,
sticker_set->was_loaded ? narrow_cast<int32>(sticker_set->sticker_ids.size()) : sticker_set->sticker_count,

View File

@ -485,6 +485,8 @@ class StickersManager final : public Actor {
StickerSetId sticker_set_id,
int64 document_id, double zoom);
static double get_sticker_set_minithumbnail_zoom(const StickerSet *sticker_set);
static tl_object_ptr<td_api::MaskPoint> get_mask_point_object(int32 point);
tl_object_ptr<td_api::stickerSetInfo> get_sticker_set_info_object(StickerSetId sticker_set_id,