,, , ,, , , , image/svg+xml , image/svg+xml , interact.js , image/svg+xml , ,, , ,

@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

modifiers/aspectRatio.ts:34

Functions

default

â–¸ default(_options?): Modifier<AspectRatioOptions, AspectRatioState, "aspectRatio", unknown>

Parameters

NameType
_options?Partial<AspectRatioOptions>

Returns

Modifier<AspectRatioOptions, AspectRatioState, "aspectRatio", unknown>

Defined in

modifiers/base.ts:43