Re: [OpenMap Users] OffsetGrabPoint bug?

From: Don Dietrick <dietrick@bbn.com>
Date: Wed Jan 28 2004 - 10:07:23 EST

Hi Brian,

Those additions are needed, for editing the position of multiple
OMGraphics simultaneously. I hadn't seen the effect you describe, but I
understand how it could happen. I've added a lock to the
OffsetGrabPoint to prevent it from trying to update itself as a result
of updating itself (if it was attached to itself somehow).

Thanks for the heads-up.

- Don

On Jan 27, 2004, at 4:57 PM, Hudson Brian R Contr AFRL/IFSF wrote:

> Don,
>
> I have been having getting StackOverflow exceptions within the
> OffsetGrabPoint class under certain circumstances when bringing
> graphics
> (typically polygons created from shape files) into the drawing tool.
>
> It was working fine in the 20031029 snapshot but I was having the
> problem
> with the 20040107 snapshot.
>
> Doing a diff on the OffsetGrabPoint class showed additions to the
> update()
> and move() functions. Commenting out these additions fixes the
> StackOverflow
> issues. Are these additions needed?
>
> Thanks,
>
> Brian Hudson
>
> (Commented sections reflect additions since the 20031029 snapshot)
>
> /**
> * Update resets the pixel offsets from the OffsetGrabPoint,
> * to the current distances between the GrabPoint and the
> * OffsetGrabPoint.
> */
> public void update() {
> offsetX = gp.getX() - getX();
> offsetY = gp.getY() - getY();
> //if (gp instanceof OffsetGrabPoint) {
> // ((OffsetGrabPoint)gp).updateOffsets();
> //}
> }
>
> /**
> * Move relocates the GrabPoint to the current position of the
> * OffsetGrabPoint plus the offset distances.
> */
> public void move() {
> int newX = getX() + offsetX;
> int newY = getY() + offsetY;
>
> if (gp instanceof HorizontalGrabPoint) {
> ((HorizontalGrabPoint)gp).set(newX, newY, true);
> } else if (gp instanceof VerticalGrabPoint) {
> ((VerticalGrabPoint)gp).set(newX, newY, true);
> } else {
> gp.set(newX, newY);
> }
>
> //if (Debug.debugging("eomg")) {
> //Debug.output("OffsetGrabPoint.offset moving GB to " +
> // newX + ", " + newY);
> //}
>
> // if (gp instanceof OffsetGrabPoint) {
> // ((OffsetGrabPoint)gp).moveOffsets();
> // }
>
> }
> }
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Jan 28 10:07:51 2004

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:37 EDT