mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 02:39:15 +02:00
Cocoa: fix drawing issue for custom-drawn listbox (issue #36714)
This commit is contained in:
parent
b7183648e0
commit
df77d2766e
@ -521,6 +521,7 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
if not Assigned(callback) then Exit;
|
if not Assigned(callback) then Exit;
|
||||||
ctx := TCocoaContext.Create(NSGraphicsContext.currentContext);
|
ctx := TCocoaContext.Create(NSGraphicsContext.currentContext);
|
||||||
|
ctx.InitDraw(round(clipRect.size.width), round(clipRect.size.height));
|
||||||
try
|
try
|
||||||
ItemState := [];
|
ItemState := [];
|
||||||
if isRowSelected(row) then Include(ItemState, odSelected);
|
if isRowSelected(row) then Include(ItemState, odSelected);
|
||||||
|
@ -945,11 +945,17 @@ procedure TCocoaThemeServices.CellDrawStart(dst: TCocoaContext; const r: Trect;
|
|||||||
var
|
var
|
||||||
acc : TCocoaContextAccess absolute dst;
|
acc : TCocoaContextAccess absolute dst;
|
||||||
begin
|
begin
|
||||||
|
NSGraphicsContext.classSaveGraphicsState;
|
||||||
cur := NSGraphicsContext.currentContext;
|
cur := NSGraphicsContext.currentContext;
|
||||||
NSGraphicsContext.setCurrentContext( acc.ctx );
|
NSGraphicsContext.setCurrentContext( acc.ctx );
|
||||||
|
|
||||||
acc.SetCGFillping(acc.CGContext, 0, -acc.Size.cy);
|
if NOT acc.ctx.isFlipped then begin
|
||||||
LCLToNSRect( R, acc.size.cy, dstRect);
|
CGContextTranslateCTM(acc.ctx.CGContext, 0, acc.Size.cy);
|
||||||
|
CGContextScaleCTM(acc.ctx.CGContext, 1, -1);
|
||||||
|
LCLToNSRect( R, acc.size.cy, dstRect);
|
||||||
|
end else begin
|
||||||
|
dstRect:= RectTONSRect(R);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCocoaThemeServices.CellDrawFrame(cell: NSCell; const dst: NSRect);
|
procedure TCocoaThemeServices.CellDrawFrame(cell: NSCell; const dst: NSRect);
|
||||||
@ -958,11 +964,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCocoaThemeServices.CellDrawEnd(dst: TCocoaContext; cur: NSGraphicsContext);
|
procedure TCocoaThemeServices.CellDrawEnd(dst: TCocoaContext; cur: NSGraphicsContext);
|
||||||
var
|
|
||||||
acc : TCocoaContextAccess absolute dst;
|
|
||||||
begin
|
begin
|
||||||
acc.SetCGFillping(acc.CGContext, 0, -acc.Size.cy);
|
NSGraphicsContext.setCurrentContext(cur);
|
||||||
NSGraphicsContext.setCurrentContext( cur );
|
NSGraphicsContext.classRestoreGraphicsState;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaThemeCallback }
|
{ TCocoaThemeCallback }
|
||||||
|
Loading…
Reference in New Issue
Block a user