Yuriy Balyuk
Yuriy Balyuk
```pascal C.Pen.Width:= R.Width; ``` [Peek 2022-07-31 16-24.webm](https://user-images.githubusercontent.com/275333/182028761-310b6532-b791-4019-b713-2b0fcf2fc135.webm)
```pascal C.Pen.Width:= R.Width {$ifdef darwin} -1 {$endif}; ``` [Peek 2022-07-31 16-30.webm](https://user-images.githubusercontent.com/275333/182028856-fcf638a0-ed79-4683-a79c-84ff4e409457.webm)
on linux it grows by pixel every time. on mac, as you can see, only on even numbers
yes. it blinks OK. but caret width has some calculation error on Mac.
   turned on antialiasing just for fun. and now i see difference between 2 px caret and 3 px caret. (without AA there was no difference) so maybe...
wait. this is not a real fix. antialiased caret just showed us that pen width is different indeed. it must work without antialiasing too.
i've found your issue: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39416 maybe it's related. I'm trying to reproduce with empty project and standard controls (TPaintBox.Canvas?) but i have little experience, can't draw a single line still....
I can paint only in OnPaint event, hmm..
test project: [canvaspen.zip](https://github.com/Alexey-T/CudaText/files/9229335/canvaspen.zip) ```pascal PaintBox1.Canvas.AntialiasingMode:= amOff; PaintBox1.Canvas.Pen.Width:= w; PaintBox1.Canvas.MoveTo(100,100); PaintBox1.Canvas.LineTo(100,200) ``` button is increasing Pen width by 1. Mac: [Peek 2022-07-31 19-51.webm](https://user-images.githubusercontent.com/275333/182037189-762ce843-46bf-4c28-b365-0aa9c4f35a3b.webm) Linux: [Peek 2022-07-31 19-54.webm](https://user-images.githubusercontent.com/275333/182037194-355bdb97-e79a-4c28-8bb1-70d651035893.webm)
I see the difference in growing sides of the line. on Mac sides of the line are growing together on every other click. on Linux they are growning alternately one...