Skip to content

Commit

Permalink
Beta version 1.4.4: Fix emoji quality.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 17, 2018
1 parent 5e872e4 commit 54f2b1b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/codegen/emoji/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ bool CheckOldInCurrent() {
const auto category = *c;
for (auto i = begin(*category); i != end(*category); ++i) {
const auto find = [](
std::initializer_list<InputCategory* const> list,
auto &&list,
const InputId &id) {
for (const auto current : list) {
if (std::find(begin(*current), end(*current), id) != end(*current)) {
Expand Down
19 changes: 15 additions & 4 deletions Telegram/SourceFiles/ui/emoji_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ constexpr auto kUniversalSize = 72;
constexpr auto kImagesPerRow = 32;
constexpr auto kImageRowsPerSprite = 16;

constexpr auto kVersion = 1;
constexpr auto kVersion = 2;

class UniversalImages {
public:
Expand Down Expand Up @@ -226,10 +226,21 @@ QImage UniversalImages::generate(int size, int index) const {
PainterHighQualityEnabler hq(p);
for (auto y = 0; y != rows; ++y) {
for (auto x = 0; x != kImagesPerRow; ++x) {
const auto single = QImage(
original.bits() + x * large * 4,
large,
large,
original.bytesPerLine(),
original.format()
).scaled(
size,
size,
Qt::IgnoreAspectRatio,
Qt::SmoothTransformation);
p.drawImage(
QRect(x * size, y * size, size, size),
original,
QRect(x * large, y * large, large, large));
x * size,
y * size,
single);
}
}
}
Expand Down

0 comments on commit 54f2b1b

Please sign in to comment.