Skip to main content
cngx-src documentation

pointerFraction

Functioncommon/interactive/sliderv0.1.0

projects/common/interactive/slider/slider-interaction.ts

Description#

Maps a pointer position to a 0..1 track fraction against el's geometry. Vertical sliders measure bottom-up (fraction 0 at the lower edge) to match the skin's bottom-anchored fill. Shared by the single slider and the range host so the geometry math lives in exactly one place.

Signature#

pointerFraction(el: HTMLElement, orientation, clientX: number, clientY: number)

Parameters#

@paramelHTMLElement
@paramorientation
@paramclientXnumber
@paramclientYnumber

Returns#

number