Hello Kambiz,
I have a problem in the Simple Graph Demo:
A Link/Line placed on startpoint X=1 or Y=1 can no longer be reduced by select the endpoint.
Can you help?
I use Version 2.72
procedure TSimpleGraph.PerformDragBy(dX, dY: Integer);
var
I: Integer;
Mobility: TObjectSides;
MinX, MinY: Integer; // by qlg
begin
if Assigned(DragSource) and ((dX <> 0) or (dY <> 0)) then
begin
Mobility := [];
for I := 0 to DraggingObjects.Count - 1 do
Mobility := Mobility + DraggingObjects[I].QueryMobility(DragHitTest);
GraphConstraints.SourceRect := DraggingBounds;
//------------------ commented by qlg begin
//if not GraphConstraints.ConfineOffset(dX, dY, Mobility) then
// Exit;
//------------------ commented by qlg end
BeginUpdate;
try
MinX := 0;
MinY := 0;
for I := 0 to DraggingObjects.Count - 1 do
begin
DraggingObjects[I].OffsetHitTest(DragHitTest, dX, dY);
MinX := Min(MinX, DraggingObjects[I].BoundsRect.Left); // added by qlg
MinY := Min(MinY, DraggingObjects[I].BoundsRect.Top); // added by qlg
end;
//------------------by qlg begin
if (MinX < 0) and (MinY < 0) then
for I := 0 to Objects.Count - 1 do
Objects[I].OffsetHitTest(GHT_BODY_MASK, -MinX, -MinY)
else
if MinX < 0 then
for I := 0 to Objects.Count - 1 do
Objects[I].OffsetHitTest(GHT_BODY_MASK, -MinX, 0)
else
if MinY < 0 then
for I := 0 to Objects.Count - 1 do
Objects[I].OffsetHitTest(GHT_BODY_MASK, 0, -MinY)
//------------------by qlg end
finally
EndUpdate;
end;
Inc(fDragTargetPt.X, dX);
Inc(fDragTargetPt.Y, dY);
ScrollInView(fDragTargetPt);
end;
end;
Return to DELPHI AREA Projects
Users browsing this forum: No registered users and 2 guests