Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [bug report]DrawTextEllipsis
[bug report]DrawTextEllipsis [message #37269] |
Fri, 14 September 2012 06:44  |
jinshiyi11
Messages: 7 Registered: October 2010 Location: CHINA
|
Promising Member |
|
|
In DrawTextEllipsis,when calculate length of text,why convert text[i] to byte?
void DrawTextEllipsis(Draw& w, int x, int y, int cx, const wchar *text, const char *ellipsis,
Font font, Color ink, int n)
{
...
int l = 0;
int i;
for(i = 0; i < n; i++) {
l += f[(byte) text[i]];
if(l > cx) {
while(l + dtl > cx && i > 0) {
l -= f[(byte) text[i]];
i--;
}
i++;
break;
}
}
...
}
[Updated on: Fri, 14 September 2012 06:47] Report message to a moderator
|
|
|
Re: [bug report]DrawTextEllipsis [message #37270 is a reply to message #37269] |
Fri, 14 September 2012 08:07   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
jinshiyi11 wrote on Fri, 14 September 2012 00:44 | In DrawTextEllipsis,when calculate length of text,why convert text[i] to byte?
void DrawTextEllipsis(Draw& w, int x, int y, int cx, const wchar *text, const char *ellipsis,
Font font, Color ink, int n)
{
...
int l = 0;
int i;
for(i = 0; i < n; i++) {
l += f[(byte) text[i]];
if(l > cx) {
while(l + dtl > cx && i > 0) {
l -= f[(byte) text[i]];
i--;
}
i++;
break;
}
}
...
}
|
Thanks, you are right. Mush have been left from very old times, when Font operator[] did not supported unicode...
Should be now fixed.
Mirek
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 23:19:57 CEST 2025
Total time taken to generate the page: 0.00740 seconds
|