U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Painter Text Underline/Strikeout not working
Re: Painter Text Underline/Strikeout not working [message #47234 is a reply to message #47233] Fri, 30 December 2016 11:05 Go to previous messageGo to previous message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
Hi,

In fact, as far as I can see, it only requires this addition in Painter.cpp in the end of Painter::TextOp():

	if(fnt.IsUnderline()||fnt.IsStrikeout()) {
		int a = fnt.GetAscent();
		int cy = max(a / 16, 1);
		if(fnt.IsUnderline()) Rectangle(0, a + cy, x, cy);
		if(fnt.IsStrikeout()) Rectangle(0, 2 * a / 3, x, cy);
	}


And removal of this in DrawOp.cpp from Painter::DrawTextOp():

/*	if(font.IsUnderline()) {
		if(IsNull(cx))
			cx = GetTextSize(text, font).cx;
		int a = font.GetAscent();
		int cy = max(a / 16, 1);
		Rectangle(0, a + cy, cx, cy);
		Fill(ink);
	}
	if(font.IsStrikeout()) {
		if(IsNull(cx))
			cx = GetTextSize(text, font).cx;
		int a = font.GetAscent();
		int cy = max(a / 16, 1);
		Rectangle(0, 2 * a / 3, cx, cy);
		Fill(ink);
	}
*/


Can you merge this change?

Best regards,

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Assertion fails in BufferPainter::TransformOp() with rotated text
Next Topic: Painter Fill with Image MSC14x64 performance issue
Goto Forum:
  


Current Time: Sun Sep 27 18:19:19 GMT+2 2026

Total time taken to generate the page: 0.01271 seconds