"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = _default;

/*
 * @Author: lianghaosen
 * @Date: 2018-12-02 14:11:49
 * @Last Modified by: lianghaosen
 * @Last Modified time: 2018-12-04 16:30:36
 */

/**
  *
  * @param {Object} placementInView
  * @param {DOMElement} container
  */
function _default(placementInView, container) {
  var containerOffset = container.getBoundingClientRect();
  return {
    left: placementInView.left - containerOffset.left + container.scrollLeft,
    top: placementInView.top - containerOffset.top + container.scrollTop
  };
}