RonShortt Posted August 11, 2021 Share Posted August 11, 2021 A textarea using TEXTAREA_WORDWRAP and SetFontScale does not wrap text correctly. Adding textarea->SetFontScale(1.5); to the textarea example code results in text which goes off the screen to the right. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 640, 480, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE); //Create User Interface auto ui = CreateInterface(window); //Create widget auto sz = ui->root->ClientSize(); auto textarea = CreateTextArea(10, 10, sz.x - 20, sz.y - 20, ui->root, TEXTAREA_WORDWRAP); textarea->SetFontScale(1.5); WString s = L"Night was falling now, and as I recalled what Akeley had written me about those earlier nights \ I shuddered to think there would be no moon. Nor did I like the way the farmhouse nestled in the lee of that\ colossal forested slope leading up to the Dark Mountain’s unvisited crest. With Akeley’s permission I lighted a small oil lamp,\ turned it low, and set it on a distant bookcase beside the ghostly bust of Milton; but afterward I was sorry I had done so, for \ it made my host’s strained, immobile face and listless hands look damnably abnormal and corpselike. He seemed half-incapable of motion, \ though I saw him nod stiffly once in a while."; textarea->SetText(s); textarea->SetLayout(1, 1, 1, 1); while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: return 0; break; } } return 0; } Untitled.bmp 1 Link to comment Share on other sites More sharing options...
Josh Posted August 19, 2021 Share Posted August 19, 2021 If you just want bigger text you should scale the interface, but I will make it work with the font scale too... My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Solution Josh Posted August 19, 2021 Solution Share Posted August 19, 2021 Fixed for next update! My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts