Not even sure this is specific to one class, it's pretty strange.

I made a simple modification to the DragPic example to demo the problem. I modified the DragPic class to include two new properties, inLinks(-1) as CurveShape and outLinks(-1) as CurveShape.

On starting, the DragCanvas creates two DragPic objects, and there is a button that will create a new CurveShape between them. The button also appends the curveshape to the outLinks array of the first DragPic and to the inLinks of the second DragPic.

During a MouseDrag, I added the following code before ReDraw is called:

  // check links
  Dim i as integer
  for i = 0 to uBound(mDragging.inLinks)
    mDragging.inLinks(i).x2 = newX
    mDragging.inLinks(i).y2 = newY
  next
  // BUG HERE
  for i = 0 to uBound(mDragging.outLinks)
    mDragging.outLinks(i).X = newX
    mDragging.outLinks(i).Y = newY
  next


So for the DragPic we are moving, it loops through every link and updates the correct end of any curves that are "attached" to that DragPic.

If I link pic 0 to 1, and then drag 1 around, the curve updates as a drag just as expected. Very Purdy.

But if I drag 0 around, the end of the curve stays attached to pict 0 as it should, but the other end's values (X2 and Y2) are also modified by the same delta that X and Y are. I stepped through it, all four values are changing in that second for loop even through I'm not changing the values to X2 and Y2.

Seems like kind of a big bug if the wrong properties are being modified. I've stared at this for hours and I can't see an error in my code, it's a pretty simple line. Is this a known bug?

Steve
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to