Yuriy Balyuk

Results 207 comments of Yuriy Balyuk
trafficstars

```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.

![image](https://user-images.githubusercontent.com/275333/182032991-29fee214-e6f4-4211-9710-afbcffd24df9.png) ![image](https://user-images.githubusercontent.com/275333/182033389-5348c911-9e39-4f51-8abd-8f80adcf827a.png) ![image](https://user-images.githubusercontent.com/275333/182033411-e0c35f14-966d-43df-993b-7e239f7b1720.png) 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...