MCPcopy
hub / github.com/ustbhuangyi/better-scroll / getTranslate

Function getTranslate

tests/util/getTranslate.ts:1–9  ·  view source on GitHub ↗
(
  transformText: string,
  direction: 'x' | 'y'
)

Source from the content-addressed store, hash-verified

1export default function getTranslate(
2 transformText: string,
3 direction: 'x' | 'y'
4) {
5 const matrix = transformText.split(')')[0].split(', ')
6 let ret =
7 direction === 'x' ? +(matrix[12] || matrix[4]) : +(matrix[13] || matrix[5])
8 return ret
9}

Callers 15

mousewheel.e2e.tsFile · 0.85
corescroll.e2e.tsFile · 0.85
one-column.e2e.tsFile · 0.85
fullpage.e2e.tsFile · 0.85
banner.e2e.tsFile · 0.85
vertical.e2e.tsFile · 0.85
dynamic.e2e.tsFile · 0.85
horizontal.e2e.tsFile · 0.85
vertical.e2e.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…