Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
Oblivion is currently offline  Oblivion
Messages: 928
Registered: August 2007
Experienced 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:

index.php?t=getfile&id=6471&private=0


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


[Updated on: Wed, 16 June 2021 15:12]

Report message to a moderator

Re: [BUG] LineEdit text renderer fails to correctly highlight underlined text . [message #57314 is a reply to message #57247] Sat, 10 July 2021 15:54 Go to previous message
mirek is currently offline  mirek
Messages: 13442
Registered: November 2005
Ultimate Member
Interesting issue; fixed.

Mirek
Previous Topic: fill date bars automatically
Goto Forum:
  


Current Time: Sat Oct 23 16:20:34 CEST 2021

Total time taken to generate the page: 0.00958 seconds