File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Sources/Interaction/Manipulators/MouseBoxSelectorManipulator Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -51,10 +51,12 @@ function vtkMouseBoxSelectionManipulator(publicAPI, model) {
51
51
return ;
52
52
}
53
53
const [ viewWidth , viewHeight ] = view . getSize ( ) ;
54
- const { width, height } = container . getBoundingClientRect ( ) ;
54
+ const { width, height, top , left } = container . getBoundingClientRect ( ) ;
55
55
const [ xMin , xMax , yMin , yMax ] = getBounds ( ) ;
56
- div . style . left = `${ ( width * xMin ) / viewWidth } px` ;
57
- div . style . top = `${ height - ( height * yMax ) / viewHeight } px` ;
56
+ const xShift = left + window . scrollX ;
57
+ const yShift = top + window . scrollY ;
58
+ div . style . left = `${ xShift + ( width * xMin ) / viewWidth } px` ;
59
+ div . style . top = `${ yShift + height - ( height * yMax ) / viewHeight } px` ;
58
60
div . style . width = `${ ( width * ( xMax - xMin ) ) / viewWidth } px` ;
59
61
div . style . height = `${ ( height * ( yMax - yMin ) ) / viewHeight } px` ;
60
62
}
You can’t perform that action at this time.
0 commit comments