Home » U++ Library support » LineEdit, EditFields, DocEdit » [BUG] LineEdit text renderer fails to correctly highlight underlined text .
[BUG] LineEdit text renderer fails to correctly highlight underlined text . [message #57247] |
Wed, 16 June 2021 15:10  |
Oblivion
Messages: 1206 Registered: August 2007
|
Senior Contributor |
|
|
Hi,
The problem: sOptimizedTextRenderer fails to render text attributes correctly on some cases (if underline attribute is involved).
Reason seems to be the non-continous text chunk rendering. When some underline text have other text with no underline attribute in between, the renderer does not erase the underline correctly.
Sscreenshot:

Test code:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyLineEdit : LineEdit {
void HighlightLine(int, Vector<Highlight>& hl, int64) override {
for(Highlight& h : hl) {
h.font.Underline(h.chr == 'U');
h.font.Bold(h.chr == 'B');
h.font.Italic(h.chr == 'I');
}
};
};
struct MyApp : TopWindow {
MyLineEdit edit;
MyApp()
{
Sizeable().Zoomable().CenterScreen().SetRect(0,0, 1024, 800);
Add(edit.SizePos());
edit.SetFont(Monospace().Height(32));
edit.Append(WString("UUU BBB III BBB\n"));
edit.Append(WString("UUU BBB III UUU\n")); // Fail: Draws underline in between even if the underline attribute is disabled.
}
};
GUI_APP_MAIN
{
MyApp().Run();
}
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Wed, 16 June 2021 15:12] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Fri May 09 09:11:58 CEST 2025
Total time taken to generate the page: 0.02983 seconds
|