Pivotable

westures. Pivotable

A Pivotable is a single input rotating around a fixed point. The fixed point is determined by the input's location at its 'start' phase.

Constructor

new Pivotable(element, handler, optionsopt)

Source:
See:
Parameters:
Name Type Attributes Description
element Element The element to which to associate the gesture.
handler function The function handler to execute when a gesture is recognized on the associated element.
options object <optional>
Gesture customization options.
Properties
Name Type Attributes Default Description
enableKeys Array.<westures-core.STATE_KEYS> <optional>
[] List of keys which will enable the gesture. The gesture will not be recognized unless one of these keys is pressed while the interaction occurs. If not specified or an empty list, the gesture is treated as though the enable key is always down.
disableKeys Array.<westures-core.STATE_KEYS> <optional>
[] List of keys which will disable the gesture. The gesture will not be recognized if one of these keys is pressed while the interaction occurs. If not specified or an empty list, the gesture is treated as though the disable key is never down.
minInputs number <optional>
1 The minimum number of pointers that must be active for the gesture to be recognized. Uses >=.
maxInputs number <optional>
Number.MAX_VALUE The maximum number of pointers that may be active for the gesture to be recognized. Uses <=.
applySmoothing boolean <optional>
true Whether to apply inertial smoothing for systems with coarse pointers.
deadzoneRadius number <optional>
15 The radius in pixels around the start point in which to do nothing.
dynamicPivot Element <optional>
false Normally the center point of the gesture's element is used as the pivot. If this option is set, the initial contact point with the element is used as the pivot instead.

Extends

  • westures.Gesture

Members

outgoing :westures-core.Smoothable

Description:
  • The outgoing data.
Source:
The outgoing data.
Type:

pivot :westures-core.Point2D

Description:
  • The pivot point of the pivotable.
Source:
The pivot point of the pivotable.
Type:

previous :number

Description:
  • The previous data.
Source:
The previous data.
Type:
  • number

Methods

restart(state)

Description:
  • Restart the given progress object using the given input object.
Source:
Parameters:
Name Type Description
state State current input state.

(abstract) updatePrevious(state)

Description:
  • Updates the previous data. It will be called during the 'start' and 'end' phases, and should also be called during the 'move' phase implemented by the subclass.
Source:
Parameters:
Name Type Description
state State the current input state.

(static) getClientCenter(element) → {westures-core.Point2D}

Description:
  • Determine the center point of the given element's bounding client rectangle.
Source:
Parameters:
Name Type Description
element Element The DOM element to analyze.
Returns:
- The center of the element's bounding client rectangle.
Type
westures-core.Point2D