summaryrefslogtreecommitdiffstats
path: root/modules/text_server_adv
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-11-10 21:52:48 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-11-10 21:52:48 +0100
commit61b62fc047235a1a73ea860fcc880de23d011a65 (patch)
treebee2114b513d6b31f269c3fb6b2d509b86fa8869 /modules/text_server_adv
parent5a0c6a8d694559bf13f81476082e7914ce056a39 (diff)
parentab52f70a0315328fbd872c06d51323a65201a217 (diff)
downloadredot-engine-61b62fc047235a1a73ea860fcc880de23d011a65.tar.gz
Merge pull request #81438 from 0xafbf/patch-2
Fix subpixel layouts in text rendering
Diffstat (limited to 'modules/text_server_adv')
-rw-r--r--modules/text_server_adv/text_server_adv.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp
index eaab04b49a..6d0a398218 100644
--- a/modules/text_server_adv/text_server_adv.cpp
+++ b/modules/text_server_adv/text_server_adv.cpp
@@ -1113,14 +1113,14 @@ _FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_bitma
case FT_PIXEL_MODE_LCD: {
int ofs_color = i * bitmap.pitch + (j * 3);
if (p_bgra) {
- wr[ofs + 0] = bitmap.buffer[ofs_color + 0];
+ wr[ofs + 0] = bitmap.buffer[ofs_color + 2];
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
- wr[ofs + 2] = bitmap.buffer[ofs_color + 2];
+ wr[ofs + 2] = bitmap.buffer[ofs_color + 0];
wr[ofs + 3] = 255;
} else {
- wr[ofs + 0] = bitmap.buffer[ofs_color + 2];
+ wr[ofs + 0] = bitmap.buffer[ofs_color + 0];
wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
- wr[ofs + 2] = bitmap.buffer[ofs_color + 0];
+ wr[ofs + 2] = bitmap.buffer[ofs_color + 2];
wr[ofs + 3] = 255;
}
} break;