Fix text_unicode.c example crashing
This commit is contained in:
parent
e4dcbd5180
commit
4c5387f837
|
|
@ -192,7 +192,14 @@ int main(void)
|
||||||
{
|
{
|
||||||
selected = hovered;
|
selected = hovered;
|
||||||
selectedPos = hoveredPos;
|
selectedPos = hoveredPos;
|
||||||
|
#if defined(PLATFORM_WEB)
|
||||||
|
// Line Feed (LF) (New Line) must be escaped for SetClipboardText() for web
|
||||||
|
char *escapedString = TextReplace(messages[emoji[selected].message].text, "\x0A", "\\n");
|
||||||
|
SetClipboardText(escapedString);
|
||||||
|
MemFree(escapedString);
|
||||||
|
#else
|
||||||
SetClipboardText(messages[emoji[selected].message].text);
|
SetClipboardText(messages[emoji[selected].message].text);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 mouse = GetMousePosition();
|
Vector2 mouse = GetMousePosition();
|
||||||
|
|
@ -342,7 +349,7 @@ static void DrawTextBoxedSelectable(Font font, const char *text, Rectangle rec,
|
||||||
{
|
{
|
||||||
int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop
|
int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop
|
||||||
|
|
||||||
float textOffsetY = 0; // Offset between lines (on line break '\n')
|
float textOffsetY = 0.0f; // Offset between lines (on line break '\n')
|
||||||
float textOffsetX = 0.0f; // Offset X to next character to draw
|
float textOffsetX = 0.0f; // Offset X to next character to draw
|
||||||
|
|
||||||
float scaleFactor = fontSize/(float)font.baseSize; // Character rectangle scaling factor
|
float scaleFactor = fontSize/(float)font.baseSize; // Character rectangle scaling factor
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user