OffsetAxisUtil extension

Extension on Offset that provides various directional utilities.

on

Methods

axisOffset(Axis axis) double

Available on Offset, provided by the OffsetAxisUtil extension

Gets the component of this offset on axis.
crossAxisOffset(Axis axis) double

Available on Offset, provided by the OffsetAxisUtil extension

Gets the component of this offset crossing axis.
directionExtent(AxisDirection direction) double

Available on Offset, provided by the OffsetAxisUtil extension

Returns the extent from origin towards direction.
rotateWithAxis(Axis axis) Offset

Available on Offset, provided by the OffsetAxisUtil extension

Rotates this offset with axis where dx becomes the cross axis extent and dy becomes the main axis extent.
rotateWithCrossAxis(Axis crossAxis) Offset

Available on Offset, provided by the OffsetAxisUtil extension

Rotates this offset with crossAxis where dx becomes the cross axis extent and dy becomes the main axis extent.

Static Methods

create(Axis axis, double cross, double main) Offset

Available on Offset, provided by the OffsetAxisUtil extension

Creates an offset with the specified cross and main components.
direction(AxisDirection direction, double cross, double main) Offset

Available on Offset, provided by the OffsetAxisUtil extension

Creates an offset where main is the extent on direction and cross is the extent counter-clockwise to direction.