Skip to content

Commit

Permalink
Merge pull request #1299
Browse files Browse the repository at this point in the history
* [#187728058] Bug fix: Marquee selection shows up in wrong subplot
  • Loading branch information
bfinzer authored Jun 6, 2024
1 parent 067dd48 commit 8fda5e9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions v3/src/components/data-display/components/background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,13 @@ export const Background = forwardRef<SVGGElement | HTMLDivElement, IProps>((prop
}, [datasetsMap]),

onDragStart = useCallback((event: PointerEvent) => {
// plotBounds.left and plotBounds.top used to be subtracted from startX and startY. But it seems to be no longer
// necessary after dragging is reimplemented without D3. Leaving these lines here just in case some bugs appear.
// const {computedBounds} = layout
// const plotBounds = computedBounds.plot
appState.beginPerformance()
selectionTree.current = prepareTree(pixiPointsArrayRef.current)
const targetRect = (event.target as HTMLElement).getBoundingClientRect()
startX.current = event.x - targetRect.left
startY.current = event.y - targetRect.top
// Event coordinates are window coordinates. To convert them to SVG coordinates, we need to subtract the
// bounding rect of the SVG element.
const bgRect = (bgRef.current as SVGGElement).getBoundingClientRect()
startX.current = event.x - bgRect.left
startY.current = event.y - bgRect.top
width.current = 0
height.current = 0
if (!event.shiftKey) {
Expand Down

0 comments on commit 8fda5e9

Please sign in to comment.