protected void avoid(mxCellState edge, mxCellState vertex)
	{
		mxIGraphModel model = graph.getModel();
		Rectangle labRect = edge.getLabelBounds().getRectangle();
		Rectangle vRect = vertex.getRectangle();

		if (labRect.intersects(vRect))
		{
			int dy1 = -labRect.y - labRect.height + vRect.y;
			int dy2 = -labRect.y + vRect.y + vRect.height;

			int dy = (Math.abs(dy1) < Math.abs(dy2)) ? dy1 : dy2;

			int dx1 = -labRect.x - labRect.width + vRect.x;
			int dx2 = -labRect.x + vRect.x + vRect.width;

			int dx = (Math.abs(dx1) < Math.abs(dx2)) ? dx1 : dx2;

			if (Math.abs(dx) < Math.abs(dy))
			{
				dy = 0;
			}
			else
			{
				dx = 0;
			}

			mxGeometry g = model.getGeometry(edge.getCell());

			if (g != null)
			{
				g = (mxGeometry) g.clone();

				if (g.getOffset() != null)
				{
					g.getOffset().setX(g.getOffset().getX() + dx);
					g.getOffset().setY(g.getOffset().getY() + dy);
				}
				else
				{
					g.setOffset(new mxPoint(dx, dy));
				}

				model.setGeometry(edge.getCell(), g);
			}
		}
	}