gdiplus: Fixed 2 GdipDrawString bugs.
This commit is contained in:
parent
a51cf1d35a
commit
92aa57bece
|
@ -1355,8 +1355,8 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
length = j;
|
length = j;
|
||||||
|
|
||||||
while(sum < length){
|
while(sum < length){
|
||||||
GetTextExtentExPointW(graphics->hdc, stringdup, length, nwidth,
|
GetTextExtentExPointW(graphics->hdc, stringdup + sum, length - sum,
|
||||||
&fit, NULL, &size);
|
nwidth, &fit, NULL, &size);
|
||||||
fitcpy = fit;
|
fitcpy = fit;
|
||||||
|
|
||||||
if(fit == 0){
|
if(fit == 0){
|
||||||
|
@ -1374,7 +1374,8 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
/* Line break code (may look strange, but it imitates windows). */
|
/* Line break code (may look strange, but it imitates windows). */
|
||||||
if(lret < fit)
|
if(lret < fit)
|
||||||
fit = lret; /* this is not an off-by-one error */
|
fit = lret; /* this is not an off-by-one error */
|
||||||
else if(*(stringdup + sum + fit) == ' ')
|
else if(fit < (length - sum)){
|
||||||
|
if(*(stringdup + sum + fit) == ' ')
|
||||||
while(*(stringdup + sum + fit) == ' ')
|
while(*(stringdup + sum + fit) == ' ')
|
||||||
fit++;
|
fit++;
|
||||||
else
|
else
|
||||||
|
@ -1389,6 +1390,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TabbedTextOutW(graphics->hdc,
|
TabbedTextOutW(graphics->hdc,
|
||||||
corners[0].x - roundr(ang_sin * (REAL) height),
|
corners[0].x - roundr(ang_sin * (REAL) height),
|
||||||
|
|
Loading…
Reference in New Issue