Api

PointRelativetoparent

OpenAPI > Point > relativeToParent

OpenAPI.Point.relativeToParent() method

相对于父级容器的坐标

Signature:

static relativeToParent(objectsArray: {
            x: number;
            y: number;
        }[], parent: {
            x: number;
            y: number;
        }): {
            x: number;
            y: number;
        }[];

Parameters

Parameter

Type

Description

objectsArray

{ x: number; y: number; }[]

对象坐标数组

parent

{ x: number; y: number; }

父级容器坐标

{ x: number; y: number; }[]

Example

const objectsArray = [{ x: 1, y: 2 }, { x: 3, y: 4 }]
const parent = { x: 5, y: 6 }
const result = OpenAPI.Point.relativeToParent(objectsArray, parent) // 返回相对于父级容器的坐标

Copyright © 2021 - 2025