index.js
function getBoundingBox() {
    if (!bounds) return // client does not want to restrict movement

    if (typeof bounds === 'boolean') {
      // for boolean type we use parent container bounds
      var ownerRect = owner.getBoundingClientRect()
      var sceneWidth = ownerRect.width
      var sceneHeight = ownerRect.height

      return {
        left: sceneWidth * boundsPadding,
        top: sceneHeight * boundsPadding,
        right: sceneWidth * (1 - boundsPadding),
        bottom: sceneHeight * (1 - boundsPadding),
      }
    }

    return bounds
  }
function getBoundingBox() {
    if (!bounds) return // client does not want to restrict movement

    if (typeof bounds === 'boolean') {
      // for boolean type we use parent container bounds
      var ownerRect = owner.getBoundingClientRect()
      var sceneWidth = ownerRect.width
      var sceneHeight = ownerRect.height

      return {
        left: sceneWidth * boundsPadding,
        top: sceneHeight * boundsPadding,
        right: sceneWidth * (1 - boundsPadding),
        bottom: sceneHeight * (1 - boundsPadding),
      }
    }

    return bounds
  }
function getBoundingBox ( ) { if ( ! bounds ) return // client does not want to restrict movement if ( typeof bounds === 'boolean' ) { // for boolean type we use parent container bounds var ownerRect = owner . getBoundingClientRect ( ) var sceneWidth = ownerRect . width var sceneHeight = ownerRect . height return { left : sceneWidth * boundsPadding , top : sceneHeight * boundsPadding , right : sceneWidth * ( 1 - boundsPadding ) , bottom : sceneHeight * ( 1 - boundsPadding ) , } } return bounds }
Returns bounding box that should be used to restrict scene movement.
Returns bounding box that should be used to restrict scene movement .