From 8702e56ba07a9d90c0eef0709e2308d583054654 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 1 Jul 2021 10:54:20 -0400 Subject: [PATCH] Fix standardize getById to return recttuple for both layouts --- packages/core/util/layouts/GranularRectLayout.ts | 6 ++++-- .../tests/__snapshots__/BreakpointSplitView.test.js.snap | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/core/util/layouts/GranularRectLayout.ts b/packages/core/util/layouts/GranularRectLayout.ts index 693507ace4..4fa7ca5eaa 100644 --- a/packages/core/util/layouts/GranularRectLayout.ts +++ b/packages/core/util/layouts/GranularRectLayout.ts @@ -517,11 +517,13 @@ export default class GranularRectLayout implements BaseLayout { return row.getItemAt(pX) } - getByID(id: string): (Record | string) | undefined { + getByID(id: string): RectTuple | undefined { const r = this.rectangles.get(id) if (r) { - return r.data || r.id + const t = (r.top as number) * this.pitchX + return [r.l * this.pitchX, t, r.r * this.pitchX, t + r.originalHeight] } + return undefined } diff --git a/products/jbrowse-web/src/tests/__snapshots__/BreakpointSplitView.test.js.snap b/products/jbrowse-web/src/tests/__snapshots__/BreakpointSplitView.test.js.snap index 5ddb28c417..641370571a 100644 --- a/products/jbrowse-web/src/tests/__snapshots__/BreakpointSplitView.test.js.snap +++ b/products/jbrowse-web/src/tests/__snapshots__/BreakpointSplitView.test.js.snap @@ -7,12 +7,12 @@ exports[`breakpoint split view open a split view 1`] = ` stroke="#333" >