Bug #3988
closed
Rectangle shifts position on resize
Added by Oliver Soong over 15 years ago.
Updated over 15 years ago.
Description
If I create a rectangle (components->workflow->workflow documentation) and resize it, the entire rectangle shifts slightly up and left.
This bug: "create a rectangle (components->workflow->workflow documentation) and
resize it," is also present in Ptolemy, but is not present in the Diva
tutorial in ptII/diva/canvas/tutorial.
I suspect that the problem is the snap to grid, but I did not stumble across
a way to disable snap to grid and change the behavior of this bug.
I might have this one fixed, Edward may have some comments.
It turns out that RectangleAttribute and ResizablePolygonAttribute had
the same bug: creating one of them and then resizing would cause the figure
to jump up and to the left. With ResizablePolygonAttribute, this was
especially obvious. However, EllipseAttribute did not have the problem.
EllipseAttribute was setting the centered Parameter to true. When I
made this change to RectangleAttribute and ResizablePolygonAttribute, the
problem went away.
I looked at a few demos and icons, and this change did not appear to cause
problems. I'm not sure why.
I'm leaving this open pending review to see if the change causes problems.
I'm closing this, my solution was to modify the configuration
so that new RectangleAttributes are created with centered set
to true, which means that new RectangleAttributes will not have
this bug, but old ones will jump around slightly. The alternative
would be to change the ctor to set centered to always be true,
which breaks existing models. A complete fix would be to fix
the old models as well, but I believe this to be very difficult
and not worth the engineering time. It is somewhat questionable
as to whether this bug should be closed, but my fix solves the
test case :-^. A new bug could be opened to fix the jump in
existing RectangleAttributes . . .
Original Bugzilla ID was 3988
Also available in: Atom
PDF