Fix font bugs

This commit is contained in:
2026-09-06 16:16:30 +02:00
committed by tobid7
parent 1e0d24e3a8
commit f725064c91
3 changed files with 6 additions and 6 deletions
+2 -3
View File
@@ -162,7 +162,7 @@ PD_API fvec2 Font::GetTextBounds(const char* text, float scale) {
u32 c;
while (it.Decode32(c)) {
auto cp = GetCodepoint(c);
if (!cp.pInvalid && c != '\n' && c != '\t' && c != ' ') {
if (cp.pInvalid && c != '\n' && c != '\t' && c != ' ') {
continue;
}
switch (c) {
@@ -211,10 +211,9 @@ PD_API void Font::CmdTextEx(Drawlist& dl, const fvec2& pos, u32 color,
U8Iterator it(text);
u32 c;
Command* cmd = nullptr;
while (it.Decode32(c)) {
auto cp = GetCodepoint(c);
if ((!cp.pInvalid && c != '\n' && c != '\t' && c != ' ') && c != '\r')
if ((cp.pInvalid && c != L'\n' && c != L'\t' && c != L' ') && c != L'\r')
continue;
if (c == L'\n') {