Beta version 1.4.4: Fix emoji quality.

This commit is contained in:
John Preston 2018-10-17 14:33:25 +03:00
parent 5e872e4d2d
commit 54f2b1b2d8
2 changed files with 16 additions and 5 deletions

View File

@ -2094,7 +2094,7 @@ bool CheckOldInCurrent() {
const auto category = *c; const auto category = *c;
for (auto i = begin(*category); i != end(*category); ++i) { for (auto i = begin(*category); i != end(*category); ++i) {
const auto find = []( const auto find = [](
std::initializer_list<InputCategory* const> list, auto &&list,
const InputId &id) { const InputId &id) {
for (const auto current : list) { for (const auto current : list) {
if (std::find(begin(*current), end(*current), id) != end(*current)) { if (std::find(begin(*current), end(*current), id) != end(*current)) {

View File

@ -24,7 +24,7 @@ constexpr auto kUniversalSize = 72;
constexpr auto kImagesPerRow = 32; constexpr auto kImagesPerRow = 32;
constexpr auto kImageRowsPerSprite = 16; constexpr auto kImageRowsPerSprite = 16;
constexpr auto kVersion = 1; constexpr auto kVersion = 2;
class UniversalImages { class UniversalImages {
public: public:
@ -226,10 +226,21 @@ QImage UniversalImages::generate(int size, int index) const {
PainterHighQualityEnabler hq(p); PainterHighQualityEnabler hq(p);
for (auto y = 0; y != rows; ++y) { for (auto y = 0; y != rows; ++y) {
for (auto x = 0; x != kImagesPerRow; ++x) { 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( p.drawImage(
QRect(x * size, y * size, size, size), x * size,
original, y * size,
QRect(x * large, y * large, large, large)); single);
} }
} }
} }