MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / currentClosestImageIndex

Function currentClosestImageIndex

website/static/js/component/carousel.js:403–408  ·  view source on GitHub ↗

* @param {Carousel} carousel

(carousel)

Source from the content-addressed store, hash-verified

401 * @param {Carousel} carousel
402 */
403function currentClosestImageIndex(carousel) {
404 const currentTransformX = -currentTransform(carousel);
405
406 const imageWidth = carousel.images[1].getBoundingClientRect().width;
407 return Math.round(currentTransformX / imageWidth);
408}
409
410/**
411 * @param {Carousel} carousel

Callers 2

slideDirectionFunction · 0.85
dragEndFunction · 0.85

Calls 1

currentTransformFunction · 0.85

Tested by

no test coverage detected