MCPcopy Create free account
hub / github.com/angular/components / _calcTickMarkTransform

Method _calcTickMarkTransform

src/material/slider/slider.ts:595–600  ·  view source on GitHub ↗

Returns the translateX positioning for a tick mark based on it's index.

(index: number)

Source from the content-addressed store, hash-verified

593
594 /** Returns the translateX positioning for a tick mark based on it's index. */
595 _calcTickMarkTransform(index: number): string {
596 // TODO(wagnermaciel): See if we can avoid doing this and just using flex to position these.
597 const offset = index * (this._tickMarkTrackWidth / (this._tickMarks.length - 1));
598 const translateX = this._isRtl() ? this._cachedWidth - 6 - offset : offset;
599 return `translateX(${translateX}px)`;
600 }
601
602 // Handlers for updating the slider ui.
603

Callers

nothing calls this directly

Calls 1

_isRtlMethod · 0.45

Tested by

no test coverage detected