mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 04:48:03 +02:00
Cocoa: Fix rect in TLCLCommonCallback.DrawBackground()
This commit is contained in:
parent
2bb8922ae8
commit
bc7ef3d1eb
@ -1413,17 +1413,16 @@ end;
|
||||
procedure TLCLCommonCallback.DrawBackground(ctx: NSGraphicsContext; const bounds, dirtyRect: NSRect);
|
||||
var
|
||||
lTarget: TWinControl;
|
||||
nsr:NSRect;
|
||||
begin
|
||||
// Implement Color property
|
||||
lTarget := TWinControl(GetTarget());
|
||||
if (lTarget.Color <> clDefault) and (lTarget.Color <> clBtnFace) then
|
||||
begin
|
||||
ColorToNSColor(ColorToRGB(lTarget.Color)).set_();
|
||||
nsr:=dirtyRect;
|
||||
if NOT Owner.isKindOfClass(NSView) or NOT NSView(Owner).isFlipped then
|
||||
nsr.origin.y:=bounds.size.height-dirtyRect.origin.y-dirtyRect.size.height;
|
||||
NSRectFill(nsr);
|
||||
// NSRectFill() always requires the coordinate system of the lower left corner
|
||||
// of the origin, contrary to the Rect provided to LCL in
|
||||
// TLCLCommonCallback.Draw() and TLCLCommonCallback.DrawOverlay()
|
||||
NSRectFill(dirtyRect);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user