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 |
Tom1
Messages: 1216 Registered: March 2007
|
Senior 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
|
|
|
|
|
Painter Text Underline/Strikeout not working
By: Tom1 on Fri, 30 December 2016 10:18
|
|
|
Re: Painter Text Underline/Strikeout not working
By: Tom1 on Fri, 30 December 2016 11:05
|
|
|
Re: Painter Text Underline/Strikeout not working
By: mirek on Sun, 01 January 2017 21:33
|
|
|
Re: Painter Text Underline/Strikeout not working
By: Tom1 on Mon, 02 January 2017 09:28
|
|
|
Re: Painter Text Underline/Strikeout not working
By: mirek on Mon, 02 January 2017 09:56
|
|
|
Re: Painter Text Underline/Strikeout not working
By: Tom1 on Mon, 02 January 2017 10:09
|
|
|
Re: Painter Text Underline/Strikeout not working
By: Tom1 on Tue, 03 January 2017 09:12
|
|
|
Re: Painter Text Underline/Strikeout not working
By: Tom1 on Mon, 16 January 2017 10:38
|
|
|
Re: Painter Text Underline/Strikeout not working
By: mirek on Mon, 16 January 2017 11:19
|
|
|
Re: Painter Text Underline/Strikeout not working
By: Tom1 on Tue, 17 January 2017 09:20
|
|
|
Re: Painter Text Underline/Strikeout not working
By: mirek on Tue, 17 January 2017 09:38
|
|
|
Re: Painter Text Underline/Strikeout not working
By: Tom1 on Tue, 17 January 2017 10:55
|
|
|
Re: Painter Text Underline/Strikeout not working
By: mirek on Tue, 17 January 2017 16:09
|
Goto Forum:
Current Time: Sun May 19 17:02:17 CEST 2024
Total time taken to generate the page: 0.00463 seconds
|