super.setAffectedObject(affectedObject);
if (affectedObject != null)
{
// Make sure we maintain the aspect ration when scaling circles and triangles
Figure presentationFigure = getAffectedFigure();
if (affectedObject instanceof VisualElement)
{
presentationFigure = ((VisualElement) affectedObject).getPresentationFigure();
}
maintainRatio = presentationFigure instanceof XTriangleFigure;
heightOnly = presentationFigure instanceof XCircleFigure;
Rectangle db = presentationFigure.displayBox();
origX = db.width;
origY = db.height;
}
}