File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/vuetify/src/util Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,21 @@ export class Box {
4
4
width : number
5
5
height : number
6
6
7
- constructor ( { x , y , width , height } : {
7
+ constructor ( args : DOMRect | {
8
8
x : number
9
9
y : number
10
10
width : number
11
11
height : number
12
12
} ) {
13
- this . x = x
14
- this . y = y
15
- this . width = width
16
- this . height = height
13
+ const pageScale = ( window as any ) ?. pageScale ?? 1
14
+ const factor = args instanceof DOMRect ? 1 + ( 1 - pageScale ) / pageScale : 1
15
+
16
+ const { x, y, width, height } = args
17
+
18
+ this . x = x * factor
19
+ this . y = y * factor
20
+ this . width = width * factor
21
+ this . height = height * factor
17
22
}
18
23
19
24
get top ( ) { return this . y }
@@ -44,7 +49,7 @@ export function getTargetBox (target: HTMLElement | [x: number, y: number]): Box
44
49
height : 0 ,
45
50
} )
46
51
} else {
47
- return target . getBoundingClientRect ( )
52
+ return new Box ( target . getBoundingClientRect ( ) )
48
53
}
49
54
}
50
55
You can’t perform that action at this time.
0 commit comments