Qt: fixed wrong X & Y coordinates when Rect param is nil and options contains ETO_OPAQUE.

git-svn-id: trunk@53829 -
This commit is contained in:
zeljko 2017-01-01 13:58:03 +00:00
parent fcdcae4206
commit 55b8db5af8

View File

@ -2198,6 +2198,7 @@ var
R, R1: TRect;
Pt: TPoint;
ALayout: QtLayoutDirection;
B: Boolean;
procedure DoDrawCharByChar(const AClipped: Boolean);
var
@ -2240,6 +2241,7 @@ begin
if not IsValidDC(DC) then Exit;
B := False;
if ((Options and (ETO_OPAQUE + ETO_CLIPPED)) <> 0) and (Rect = nil) then
begin
if Count >= 0 then
@ -2249,6 +2251,7 @@ begin
R := QtDC.getClipRegion.getBoundingRect;
QtDC.font.Metrics.boundingRect(@R1, @R, 0, @WideStr);
B := True;
Rect := @R1;
end;
@ -2260,7 +2263,10 @@ begin
begin
// couldn't find way to fix it.
end;
QtDC.fillRect(Rect^.Left, Rect^.Top, Rect^.Right - Rect^.Left, Rect^.Bottom - Rect^.Top);
if B then
QtDC.fillRect(X, Y, Rect^.Right - Rect^.Left, Rect^.Bottom - Rect^.Top)
else
QtDC.fillRect(Rect^.Left, Rect^.Top, Rect^.Right - Rect^.Left, Rect^.Bottom - Rect^.Top);
end else
if ((Options and ETO_OPAQUE) = 0) and (Rect <> nil) and (QtDC.getBKMode = OPAQUE) then
begin