From 1553d7b70f17fbc38dedcff9ceceaef1715ece14 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 22 Sep 2019 09:00:26 +0800 Subject: [PATCH] Use copyTo for same size glyph --- src/font/font_with_face.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/font/font_with_face.cpp b/src/font/font_with_face.cpp index 0eda88bef..7f5b4e9e0 100644 --- a/src/font/font_with_face.cpp +++ b/src/font/font_with_face.cpp @@ -288,7 +288,12 @@ void FontWithFace::insertGlyph(unsigned font_number, unsigned glyph_index) ->getVideoDriver()->createImage(video::ECF_A8R8G8B8, { cur_glyph_width , cur_glyph_height}); assert(scaled); - if (cur_glyph_width >= bits->width || + if (cur_glyph_width == bits->width && + cur_glyph_height == bits->rows) + { + unscaled->copyTo(scaled); + } + else if (cur_glyph_width >= bits->width || cur_glyph_height >= bits->rows) { unscaled->copyToScaling(scaled);