AutoLineTo different to AutoMoveTo

Is there any reason why AutoMoveTo uses the Rotated coordinates of the defined point but AutoLineTo uses the unRotated coordinates? This makes a real mess of a drawing if the Block is rotated. I have modified AutoLineTo to use RotX() and it works fine for me (so far). Would it be possible to either change this or add a proper procedure that includes Rotation?

procedure TBlockDrawer.AutoLineTo(X, Y: double);
var
  P: TPoint;
begin
  if Canvas <> nil then
  begin
    P := RoundPoint(PP(X, Y));
    Canvas.LineTo(P.X, P.Y);
  end;
end;

procedure TBlockDrawer.AutoMoveTo(X, Y: double);
var
  P: TPoint;
begin
  if Canvas <> nil then
  begin
    P := RoundPoint(RotX(PP(X, Y)));
    Canvas.MoveTo(P.X, P.Y);
  end;
end;

Indeed, it looks like it was overlooked. Analyzing Diagram Studio source code, all uses of AutoLineTo are for drawing and blocks that are not supposed to be rotated.

However, changing what's there might break existing users code. Can't you simply create your own AutoLineTo which includes calling RotX and use it?

Yes, of course I can create my own version, but it just seems an untidy solution and I could not see any good reason why it is like that.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.