setDraggedGuideLine(null);
}
public void mouseDragged(final MouseEvent e)
{
final GuideLine dragged = getDraggedGuideLine();
if (dragged == null || guideLineIndex == -1)
{
return;
}
double start = 0;
final PageDefinition pageDefinition = getPageDefinition();
if (pageDefinition == null)
{
return;
}
if (isShowTopBorder())
{
start = getTopBorder();
}
final ZoomModel zoomModel = getZoomModel();
final LinealModel linealModel = getLinealModel();
final double scaledPos = (e.getY() / zoomModel.getZoomAsPercentage()) - start;
final float pageHeight = pageDefinition.getHeight();
final double position = Math.min((double) pageHeight, Math.max((double) 0, scaledPos));
final GuideLine newGuideLine = new GuideLine(position, dragged.isActive());
final UndoManager undo = getRenderContext().getUndo();
undo.addChange(new UpdateVerticalGuidelineUndoEntry(guideLineIndex, newGuideLine, dragged, getInstanceID()));
linealModel.updateGuideLine(guideLineIndex, newGuideLine);
}