mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 01:06:02 +02:00
LazVirtualTrees: removed cocoa workaround from PaintHeader. related to the issue #41313
This commit is contained in:
parent
8148379d00
commit
ff108ae5b6
@ -9244,9 +9244,9 @@ procedure TVirtualTreeColumns.PaintHeader(DC: HDC; const R: TRect; HOffset: Inte
|
|||||||
var
|
var
|
||||||
VisibleFixedWidth: Integer;
|
VisibleFixedWidth: Integer;
|
||||||
RTLOffset: Integer;
|
RTLOffset: Integer;
|
||||||
{$ifdef LCLCocoa}
|
{.$ifdef LCLCocoa}
|
||||||
sc : Double;
|
sc : Double;
|
||||||
{$endif}
|
{.$endif}
|
||||||
|
|
||||||
procedure PaintFixedArea;
|
procedure PaintFixedArea;
|
||||||
|
|
||||||
@ -9258,20 +9258,16 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
if Assigned(Header) and Assigned(Header.TreeView) then
|
||||||
|
sc := Header.Treeview.GetCanvasScaleFactor
|
||||||
|
else
|
||||||
|
sc := 1.0;
|
||||||
// Adjust size of the header bitmap
|
// Adjust size of the header bitmap
|
||||||
with TWithSafeRect(FHeader.Treeview.FHeaderRect) do
|
with TWithSafeRect(FHeader.Treeview.FHeaderRect) do
|
||||||
begin
|
begin
|
||||||
FHeaderBitmap.Width := Max(Right, R.Right - R.Left);
|
FHeaderBitmap.Clear;
|
||||||
FHeaderBitmap.Height := Bottom;
|
FHeaderBitmap.SetSize(Round(Max(Right, R.Right - R.Left) * sc), Round(Bottom * sc));
|
||||||
{$ifdef LCLCocoa}
|
LCLIntf.SetDeviceScaleRatio(FHeaderBitmap.Canvas.Handle, sc);
|
||||||
if Assigned(Header) and Assigned(Header.TreeView) then
|
|
||||||
sc := Header.Treeview.GetCanvasScaleFactor
|
|
||||||
else
|
|
||||||
sc := 1.0;
|
|
||||||
FHeaderBitmap.Width := Round(FHeaderBitmap.Width * sc);
|
|
||||||
FHeaderBitmap.Height := Round(FHeaderBitmap.Height * sc);
|
|
||||||
CGContextScaleCTM(TCocoaBitmapContext(FHeaderBitmap.Canvas.Handle).CGContext, sc, sc);
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
VisibleFixedWidth := GetVisibleFixedWidth;
|
VisibleFixedWidth := GetVisibleFixedWidth;
|
||||||
@ -9296,15 +9292,7 @@ begin
|
|||||||
|
|
||||||
// Blit the result to target.
|
// Blit the result to target.
|
||||||
with TWithSafeRect(R) do
|
with TWithSafeRect(R) do
|
||||||
{$ifdef LCLCocoa}
|
BitBlt(DC, Left, Top, Round((Right - Left) * sc), Round((Bottom - Top) * sc), FHeaderBitmap.Canvas.Handle, Left, Top, SRCCOPY);
|
||||||
StretchBlt(DC, Left, Top, Right - Left, Bottom - Top,
|
|
||||||
FHeaderBitmap.Canvas.Handle,
|
|
||||||
Left, Top,
|
|
||||||
FHeaderBitmap.Width, FHeaderBitmap.Height,
|
|
||||||
SRCCOPY);
|
|
||||||
{$else}
|
|
||||||
BitBlt(DC, Left, Top, Right - Left, Bottom - Top, FHeaderBitmap.Canvas.Handle, Left, Top, SRCCOPY);
|
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user