mirror of
https://github.com/umap-project/umap.git
synced 2025-04-30 20:12:37 +02:00
fix: window.offsetHeight does not means anything
This commit is contained in:
parent
42e7fb8dae
commit
89c13a3b7e
1 changed files with 3 additions and 3 deletions
|
@ -66,13 +66,13 @@ export class Positioned {
|
||||||
computePosition([x, y]) {
|
computePosition([x, y]) {
|
||||||
let left
|
let left
|
||||||
let top
|
let top
|
||||||
if (x < window.offsetWidth / 2) {
|
if (x < window.innerWidth / 2) {
|
||||||
left = x
|
left = x
|
||||||
} else {
|
} else {
|
||||||
left = x - this.container.offsetWidth
|
left = x - this.container.offsetWidth
|
||||||
}
|
}
|
||||||
if (y < window.offsetHeight / 2) {
|
if (y < window.innerHeight / 2) {
|
||||||
top = Math.min(y, window.offsetHeight - this.container.offsetHeight)
|
top = Math.min(y, window.innerHeight - this.container.offsetHeight)
|
||||||
} else {
|
} else {
|
||||||
top = Math.max(0, y - this.container.offsetHeight)
|
top = Math.max(0, y - this.container.offsetHeight)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue