mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-03 07:23:55 +00:00
Improve centering within given node
This commit is contained in:
parent
f799f727b2
commit
593109e8c5
1 changed files with 3 additions and 2 deletions
|
|
@ -31,8 +31,9 @@ class WindowManager extends React.Component {
|
|||
centerWindows = () => {
|
||||
const { container } = this.props;
|
||||
|
||||
const offsetLeft = container.offsetLeft;
|
||||
const offsetTop = container.offsetTop;
|
||||
const rect = container.getBoundingClientRect();
|
||||
const offsetLeft = rect.left + window.scrollX;
|
||||
const offsetTop = rect.top + window.scrollY;
|
||||
const width = container.scrollWidth;
|
||||
const height = container.scrollHeight;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue