mirror of
https://github.com/umap-project/umap.git
synced 2025-04-30 12:12:36 +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]) {
|
||||
let left
|
||||
let top
|
||||
if (x < window.offsetWidth / 2) {
|
||||
if (x < window.innerWidth / 2) {
|
||||
left = x
|
||||
} else {
|
||||
left = x - this.container.offsetWidth
|
||||
}
|
||||
if (y < window.offsetHeight / 2) {
|
||||
top = Math.min(y, window.offsetHeight - this.container.offsetHeight)
|
||||
if (y < window.innerHeight / 2) {
|
||||
top = Math.min(y, window.innerHeight - this.container.offsetHeight)
|
||||
} else {
|
||||
top = Math.max(0, y - this.container.offsetHeight)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue