@interactjs / modifiers/aspectRatio
Module: modifiers/aspectRatio
Description
This modifier forces elements to be resized with a specified dx/dy ratio.
interact(target).resizable({
modifiers: [
interact.modifiers.snapSize({
targets: [ interact.snappers.grid({ x: 20, y: 20 }) ],
}),
interact.aspectRatio({ ratio: 'preserve' }),
],
});
Table of contents
Namespaces
Interfaces
Type Aliases
Functions
Type Aliases
AspectRatioState
Ƭ AspectRatioState: ModifierState<AspectRatioOptions, { edgeSign: { x: number ; y: number } ; equalDelta: boolean ; linkedEdges: EdgeOptions ; ratio: number ; startCoords: Point ; startRect: Rect ; subModification: Modification ; xIsPrimaryAxis: boolean }>
Defined in
Functions
default
â–¸ default(_options?): Modifier<AspectRatioOptions, AspectRatioState, "aspectRatio", unknown>
Parameters
| Name | Type |
|---|---|
_options? | Partial<AspectRatioOptions> |
Returns
Modifier<AspectRatioOptions, AspectRatioState, "aspectRatio", unknown>