Assistive-Webdriver

Home > assistive-playwright-client > CalibrationResult > translateCoordinates

CalibrationResult.translateCoordinates() method

Translates viewport coordinates or coordinates relative to the center of a DOM element into screen coordinates.

Signature:

translateCoordinates(position: SimplePosition, origin?: ElementHandle<HTMLElement | SVGElement> | null): Promise<ScreenPosition>;

Parameters

Parameter Type Description
position SimplePosition if origin is null, coordinates in the viewport, otherwise, coordinates relative to the center of the DOM element whose reference is passed in origin.
origin ElementHandle<HTMLElement | SVGElement> | null DOM element whose center is the origin of the coordinates passed in position. If null (the default), position is relative to the top-left corner of the viewport.

Returns:

Promise<ScreenPosition>