lazy-widgets
Version:
Typescript retained mode GUI for the HTML canvas API
12 lines • 423 B
JavaScript
/**
* Convert a point relative to a viewport into an absolute coordinate. You
* usually only need this if {@link Viewport#relativeCoordinates} is true.
*
* @category Helper
*/
export function viewportRelativePointToAbsolute(viewport, x, y) {
x += viewport.rect[0] + viewport.offset[0];
y += viewport.rect[1] + viewport.offset[1];
return [x, y];
}
//# sourceMappingURL=viewportRelativePointToAbsolute.js.map