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) {
5151 return ;
5252 }
5353 const [ viewWidth , viewHeight ] = view . getSize ( ) ;
54- const { width, height } = container . getBoundingClientRect ( ) ;
54+ const { width, height, top , left } = container . getBoundingClientRect ( ) ;
5555 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` ;
5860 div . style . width = `${ ( width * ( xMax - xMin ) ) / viewWidth } px` ;
5961 div . style . height = `${ ( height * ( yMax - yMin ) ) / viewHeight } px` ;
6062 }
You can’t perform that action at this time.
0 commit comments