getLocalPoint method

Point getLocalPoint(
  1. Point p, [
  2. Point? result
])

Given a Point in document coordinates, returns a new Point in local coordinates.

For example, if you have a mouse event whose InputEvent#documentPoint is at 122, 213, and if you have a Node whose #position is at 100, 200, node.getLocalPoint(e.documentPoint) could return a Point that is at 22, 13. For a GraphObject within the Node named "TB",

  node.findObject("TB").getLocalPoint(e.documentPoint)

could return a Point that is at 15.7, 6.7, if that "TB" object is positioned somewhat inside the bounds of the Node. @param {Point} p a real Point in document coordinates. @param {Point=} result an optional Point that is modified and returned. @return {Point} The corresponding Point in local coordinates. @see #getDocumentPoint

Implementation

_i3.Point getLocalPoint(
  _i3.Point p, [
  _i3.Point? result,
]) =>
    _i4.callMethod(
      this,
      'getLocalPoint',
      [
        p,
        result ?? _i5.undefined,
      ],
    );