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 #47445 is a reply to message #47442] Tue, 17 January 2017 09:38 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Missed that one. However, looking at the code (and compiler warnings), should not these 'int's be really 'double's?

	if(fnt.IsUnderline() || fnt.IsStrikeout()) {
		double a = fnt.GetAscent();
		double cy = max(a / 16, 1.0);
		double cx = x - p.x;
		if(fnt.IsUnderline())
			Rectangle(p.x, p.y + a + cy, cx, cy);
		if(fnt.IsStrikeout())
			Rectangle(p.x, p.y + 2 * a / 3, cx, cy);
	}


Maybe even that 'max' is not really needed...

(Commiting with doubles, for now)
 
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: Thu Sep 10 01:13:24 GMT+2 2026

Total time taken to generate the page: 0.00712 seconds