How to use the @pluginjs/utils.convertMatrixToArray function in @pluginjs/utils

To help you get started, we’ve selected a few @pluginjs/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pluginjs / pluginjs / modules / scrollbar / src / main.js View on Github external
getHandlePosition() {
    let value
    if (this.options.useCssTransforms && transform) {
      const transform = getStyle(TRANSFORM, this.$handle)
      value = convertMatrixToArray(transform)
      if (!value) {
        return 0
      }

      if (this.attributes.axis === 'X') {
        value = value[12] || value[4]
      } else {
        value = value[13] || value[5]
      }
    } else {
      value = getStyle(this.attributes.position, this.$handle)
    }

    return parseFloat(value.replace('px', ''))
  }