Skip to main content

Function: getElementVertices()

getElementVertices(element, canvasBounds?, scale?): object

Computes helpful values about a rotated element, Useful in calculating updated element locations.

Parameters​

element​

The element to calculate the vertices for.

height​

number

rotation​

number

width​

number

x​

number

y​

number

canvasBounds?​

Point = ...

scale?​

Point = ...

Returns​

object

a, b, c, d starting from top left and moving clockwise. Center represents the point central to all vertices on thge element.

a​

a: object

a.x​

x: number

a.y​

y: number

b​

b: object

b.x​

x: number

b.y​

y: number

c​

c: object

c.x​

x: number

c.y​

y: number

center​

center: Point = pointOfRotation

d​

d: object

d.x​

x: number

d.y​

y: number