Capítulo 275 de 411

Chapter 275: MotionPathPlugin.getAlignMatrix()

Core Idea

Returns a Matrix2D for aligning one element to another, accounting for all (even nested) transforms — apply it to move fromElement so a chosen point on it lines up with a chosen point on toElement.

Reference Tables

ParameterTypeDescription
fromElementElement | windowelement to be aligned
toElementElement | windowelement to align with
fromOriginArray (optional)progress point on fromElement, e.g. [0.5, 0.5] (center)
toOriginArray | Stringcorresponding point on toElement

Returns: Matrix2D (has an apply() method to convert any point).

Connects To

  • Align transformOrigin of two elements (Helper): a practical use case built on similar matrix math.