mxGraph graph = graphComponent.getGraph();
double scale = graph.getView().getScale();
if (gridEnabledEvent)
{
dx = graph.snap(dx / scale) * scale;
dy = graph.snap(dy / scale) * scale;
}
mxRectangle bounds = union(getState(), dx, dy, index);
bounds.setWidth(bounds.getWidth() + 1);