Qt: fixed TQtWidgetSet.ExtTextOut() where ETO_CLIPPED wasn't respected.

git-svn-id: trunk@32786 -
This commit is contained in:
zeljko 2011-10-09 16:24:56 +00:00
parent 1bb16ace8f
commit ddfb07097a

View File

@ -2193,6 +2193,7 @@ function TQtWidgetSet.ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint;
var
WideStr: WideString;
QtDC: TQtDeviceContext absolute DC;
B: Boolean;
begin
{$ifdef VerboseQtWinAPI}
WriteLn('[WinAPI ExtTextOut]');
@ -2215,7 +2216,19 @@ begin
else
WideStr := GetUtf8String(Str);
QtDC.drawText(X, Y, @WideStr);
if (Options and ETO_CLIPPED <> 0) then
begin
B := QtDC.getClipping;
if not B then
begin
QtDC.save;
QtDC.setClipRect(Rect^);
end;
QtDC.drawText(X, Y, Rect^.Right - Rect^.Left, Rect^.Bottom - Rect^.Top, 0, @WideStr);
if not B then
QtDC.restore;
end else
QtDC.drawText(X, Y, @WideStr);
end;
Result := True;