From c71e6ff946e90aee582dd4a27dd62b803cfa9b1c Mon Sep 17 00:00:00 2001 From: Pk11 Date: Sat, 23 Jan 2021 14:42:44 -0600 Subject: [PATCH] Flip `<` and `>` in RTL too --- source/font.cpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/source/font.cpp b/source/font.cpp index 8cb8de5..3893bc5 100644 --- a/source/font.cpp +++ b/source/font.cpp @@ -287,14 +287,28 @@ ITCM_CODE void Font::print(std::u16string_view text, int x, int y, bool top, int // Brackets are flipped in RTL if(rtl) { - if(*it == '(') - index = charIndex(')'); - else if(*it == ')') - index = charIndex('('); - else if(*it == '[') - index = charIndex(']'); - else if(*it == ']') - index = charIndex('['); + switch(*it) { + case '(': + index = getCharIndex(')'); + break; + case ')': + index = getCharIndex('('); + break; + case '[': + index = getCharIndex(']'); + break; + case ']': + index = getCharIndex('['); + break; + case '<': + index = getCharIndex('>'); + break; + case '>': + index = getCharIndex('<'); + break; + default: + break; + } } if(sprite) {