mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 16:05:55 +02:00
LCL Carbon: exclude last pixel when rasterizating line
git-svn-id: trunk@14445 -
This commit is contained in:
parent
8aedb53f6c
commit
8dde11e9ab
@ -1042,11 +1042,21 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCarbonDeviceContext.LineTo(X, Y: Integer);
|
||||
begin
|
||||
CGContextBeginPath(CGContext);
|
||||
// add 0.5 to both coordinates for better rasterization
|
||||
CGContextMoveToPoint(CGContext, PenPos.x + 0.5, PenPos.y + 0.5);
|
||||
CGContextAddLineToPoint(CGContext, X + 0.5, Y + 0.5);
|
||||
CGContextStrokePath(CGContext);
|
||||
if CurrentPen.Width = 1 then
|
||||
begin
|
||||
CGContextSaveGState(CGContext);
|
||||
ExcludeClipRect(X, Y, X + 1, Y + 1);
|
||||
end;
|
||||
|
||||
try
|
||||
CGContextBeginPath(CGContext);
|
||||
// add 0.5 to both coordinates for better rasterization
|
||||
CGContextMoveToPoint(CGContext, PenPos.x + 0.5, PenPos.y + 0.5);
|
||||
CGContextAddLineToPoint(CGContext, X + 0.5, Y + 0.5);
|
||||
CGContextStrokePath(CGContext);
|
||||
finally
|
||||
if CurrentPen.Width = 1 then CGContextRestoreGState(CGContext);
|
||||
end;
|
||||
|
||||
FPenPos.x := X;
|
||||
FPenPos.y := Y;
|
||||
|
@ -198,6 +198,9 @@ type
|
||||
constructor Create(AGlobal: Boolean); // create default pen
|
||||
constructor Create(ALogPen: TLogPen);
|
||||
procedure Apply(ADC: TCarbonContext; UseROP2: Boolean = True);
|
||||
|
||||
property Width: Integer read FWidth;
|
||||
property Style: LongWord read FStyle;
|
||||
end;
|
||||
|
||||
{ TCarbonBitmap }
|
||||
|
Loading…
Reference in New Issue
Block a user