@Override
  public int positionToRow(final double y) {
    // TODO: This does not really work because line heights are not constant.

    final ZyLabelContent content = getNodeContent();

    final Rectangle2D contentBounds = getNodeContent().getBounds();
    final double yratio = getHeight() / contentBounds.getHeight();

    final int row = (int) ((y / yratio - content.getPaddingTop()) / content.getLineHeight());

    return row >= content.getLineCount() ? -1 : row;
  }
Converts a y coordinate into a line number of the node content.

@param y The y coordinate.
@return The number of the line shown at the y address or -1 if there is no line at the given
    coordinates.
java/zylib/src/main/java/com/google/security/zynamics/zylib/yfileswrap/gui/zygraph/realizers/ZyNodeRealizer.java