code: public static Point layerToParent(Layer layer, Layer parent, XY point, Point into) {
      into.set(point);
      while (layer != parent) {
        if (layer == null) {
          throw new IllegalArgumentException(
            "Failed to find parent, perhaps you passed parent, layer instead of "
            + "layer, parent?");
        }
        into.x -= layer.originX();
        into.y -= layer.originY();
        layer.transform().transform(into, into);
        layer = layer.parent();
      }
      return into;
    }
docs: Converts the supplied point from coordinates relative to the specified
  child layer to coordinates relative to the specified parent layer. The
  results are stored into {@code into}, which is returned for convenience.