TCanvas.DrawLine behaves differently on Windows and on iOS


When drawing a list of connected lines using TCanvas.DrawLine they are not drawn connected on iOS, but they are on Windows. Here are the results of a simple test app connecting 40 points:

Targeting iPad 2 on simulator (non-retina, but it also happens on retina) I get this:

Targeting 32-bit Windows I get this:

The code in the test app (to reproduce the problem I have in a much more complex app):

LineList: array[0..39] = (
(X:8.00; Y:45.00),
(X:14.00; Y:43.00),
(X:21.00; Y:43.00),
(X:27.00; Y:44.00),
(X:31.00; Y:45.00),
(X:37.00; Y:45.00),
(X:40.00; Y:43.00),

procedure TForm24.PaintBox1Paint(Sender: TObject; Canvas: TCanvas);
var i: integer;
Canvas.StrokeThickness := 6;
Canvas.Stroke.Kind := TBrushKind.Solid;
Canvas.Stroke.Color := $FF000000;
for i := 1 to 39 do
Canvas.DrawLine(LineList[i-1], LineList[i], 1.0);

Note: problem increases the higher value of StrokeThickness. If set to 1 the problem is gone.
I am using Delphi 10 Seattle update 1.

What can I do to solve this?


Reported as a bug here:

Comments are closed.