- changed title to Canvas.LineTo wrong, when pen.width > 1
Canvas.LineTo wrong, when pen.width > 1
The lineTo-Function takes not the width of the pen into account (drawing starts always on same position, but the half of pen-width has to be devided and substract from x and y in painting)
See attached a screenshot, that shows the diffrence in painting on windows and linux/mac OS.
procedure TForm7.pbPaint(Sender: TObject);
begin
with pb.Canvas do begin
Pen.Width := 1;
MoveTo(100,100);
LineTo(300, 100);
Pen.Width := 20;
MoveTo(100 + 20,100);
LineTo(300, 100);
end;
end;
By the way, thank you for the big amount of fixes in version 1.11c.
(Why the text is doubled here?)
Comments (3)
-
reporter -
reporter - edited description
The lineTo-Function takes not the width of the pen into account (drawing starts always on same position, but the half of pen-width has to be devided and substract from x and y in painting)
See attached a screenshot, that shows the diffrence in painting on windows and linux/mac OS.
procedure TForm7.pbPaint(Sender: TObject);
begin
with pb.Canvas do beginPen.Width := 1; MoveTo(100,100); LineTo(300, 100); Pen.Width := Linewidth; MoveTo(100 + Linewidth,100); LineTo(300, 100);
end;
end;
By the way, thank you for the big amount of fixes in version 1.11c.
-
reporter - edited description
The lineTo-Function takes not the width of the pen into account (drawing starts always on same position, but the half of pen-width has to be devided and substract from x and y in painting)
See attached a screenshot, that shows the diffrence in painting on windows and linux/mac OS.
procedure TForm7.pbPaint(Sender: TObject);
begin
with pb.Canvas do beginPen.Width := 1; MoveTo(100,100); LineTo(300, 100); Pen.Width := 20; MoveTo(100 + 20,100); LineTo(300, 100);
end;
end;
By the way, thank you for the big amount of fixes in version 1.11c.
- Log in to comment
The lineTo-Function takes not the width of the pen into account (drawing starts always on same position, but the half of pen-width has to be devided and substract from x and y in painting)
See attached a screenshot, that shows the diffrence in painting on windows and linux/mac OS.
procedure TForm7.pbPaint(Sender: TObject);
begin
with pb.Canvas do begin
end;
end;
By the way, thank you for the big amount of fixes in version 1.11c.