gdiplus: Use DrawText instead of TabbedTextOut.
This commit is contained in:
parent
ca94939308
commit
be66c3c93b
|
@ -1287,6 +1287,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
INT sum = 0, height = 0, fit, fitcpy, save_state, i, j, lret, nwidth,
|
INT sum = 0, height = 0, fit, fitcpy, save_state, i, j, lret, nwidth,
|
||||||
nheight;
|
nheight;
|
||||||
SIZE size;
|
SIZE size;
|
||||||
|
RECT drawcoord;
|
||||||
|
|
||||||
if(!graphics || !string || !font || !brush || !rect)
|
if(!graphics || !string || !font || !brush || !rect)
|
||||||
return InvalidParameter;
|
return InvalidParameter;
|
||||||
|
@ -1366,15 +1367,16 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
length = j;
|
length = j;
|
||||||
|
|
||||||
while(sum < length){
|
while(sum < length){
|
||||||
|
drawcoord.left = corners[0].x + roundr(ang_sin * (REAL) height);
|
||||||
|
drawcoord.top = corners[0].y + roundr(ang_cos * (REAL) height);
|
||||||
|
|
||||||
GetTextExtentExPointW(graphics->hdc, stringdup + sum, length - sum,
|
GetTextExtentExPointW(graphics->hdc, stringdup + sum, length - sum,
|
||||||
nwidth, &fit, NULL, &size);
|
nwidth, &fit, NULL, &size);
|
||||||
fitcpy = fit;
|
fitcpy = fit;
|
||||||
|
|
||||||
if(fit == 0){
|
if(fit == 0){
|
||||||
TabbedTextOutW(graphics->hdc,
|
DrawTextW(graphics->hdc, stringdup + sum, 1, &drawcoord, DT_NOCLIP |
|
||||||
corners[0].x + roundr(ang_sin * (REAL) height),
|
DT_EXPANDTABS);
|
||||||
corners[0].y + roundr(ang_cos * (REAL) height),
|
|
||||||
stringdup + sum, 1, 0, 0, 0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1402,10 +1404,8 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TabbedTextOutW(graphics->hdc,
|
DrawTextW(graphics->hdc, stringdup + sum, min(length - sum, fit),
|
||||||
corners[0].x - roundr(ang_sin * (REAL) height),
|
&drawcoord, DT_NOCLIP | DT_EXPANDTABS);
|
||||||
corners[0].y + roundr(ang_cos * (REAL) height),
|
|
||||||
stringdup + sum, min(length - sum, fit), 0, 0, 0);
|
|
||||||
|
|
||||||
sum += fit + (lret < fitcpy ? 1 : 0);
|
sum += fit + (lret < fitcpy ? 1 : 0);
|
||||||
height += size.cy;
|
height += size.cy;
|
||||||
|
|
Loading…
Reference in New Issue