src/render/vue/components/slider/indicator.js
function _reLayout (context, virtualRect, ltbr) {
  const el = context.$el
  const rect = _getIndicatorRect(el)
  const rectWithPx = Object.keys(rect).reduce((pre, key) => {
    pre[key] = rect[key] + 'px'
    return pre
  }, {})
  extend(el.style, rectWithPx)
  const axisMap = [
    { dir: ltbr.left ? 'left' : ltbr.right ? 'right' : 'left', scale: 'width' },
    { dir: ltbr.top ? 'top' : ltbr.bottom ? 'bottom' : 'top', scale: 'height' }
  ]
  Object.keys(axisMap).forEach(key => {
    const { dir, scale } = axisMap[key]
    el.style[dir] = ltbr[dir] + virtualRect[scale] / 2 - rect[scale] / 2 + 'px'
  })
}
function _reLayout (context, virtualRect, ltbr) {
  const el = context.$el
  const rect = _getIndicatorRect(el)
  const rectWithPx = Object.keys(rect).reduce((pre, key) => {
    pre[key] = rect[key] + 'px'
    return pre
  }, {})
  extend(el.style, rectWithPx)
  const axisMap = [
    { dir: ltbr.left ? 'left' : ltbr.right ? 'right' : 'left', scale: 'width' },
    { dir: ltbr.top ? 'top' : ltbr.bottom ? 'bottom' : 'top', scale: 'height' }
  ]
  Object.keys(axisMap).forEach(key => {
    const { dir, scale } = axisMap[key]
    el.style[dir] = ltbr[dir] + virtualRect[scale] / 2 - rect[scale] / 2 + 'px'
  })
}
function _reLayout ( context , virtualRect , ltbr ) { const el = context . $el const rect = _getIndicatorRect ( el ) const rectWithPx = Object . keys ( rect ) . reduce ( ( pre , key ) => { pre [ key ] = rect [ key ] + 'px' return pre } , { } ) extend ( el . style , rectWithPx ) const axisMap = [ { dir : ltbr . left ? 'left' : ltbr . right ? 'right' : 'left' , scale : 'width' } , { dir : ltbr . top ? 'top' : ltbr . bottom ? 'bottom' : 'top' , scale : 'height' } ] Object . keys ( axisMap ) . forEach ( key => { const { dir , scale } = axisMap [ key ] el . style [ dir ] = ltbr [ dir ] + virtualRect [ scale ] / 2 - rect [ scale ] / 2 + 'px' } ) }
calculate and reset indicator's width, height, and ltbr.
@param {object} virtualRect. width and height of indicator's virtual rect box.
@param {object} ltbr. the user specified left, top, bottom, right pixels (without units).
calculate and reset indicator s width height and ltbr .