Skip to content

Commit

Permalink
Fix standardize getById to return recttuple for both layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jul 1, 2021
1 parent 7a4a8e9 commit 8702e56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/core/util/layouts/GranularRectLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,13 @@ export default class GranularRectLayout<T> implements BaseLayout<T> {
return row.getItemAt(pX)
}

getByID(id: string): (Record<string, T> | 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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ exports[`breakpoint split view open a split view 1`] = `
stroke="#333"
>
<path
d="M 407.99312656000257 80.5 C 607.9931265600026 80.5 203.41868021525443 89.5 403.4186802152544 89.5"
d="M 407.99312656000257 143.5 C 607.9931265600026 143.5 203.41868021525443 173.5 403.4186802152544 173.5"
data-testid="r1"
stroke-width="1"
/>
<path
d="M 660.4186802152544 89.5 C 860.4186802152544 89.5 206.99312656000257 53.5 406.99312656000257 53.5"
d="M 660.4186802152544 173.5 C 860.4186802152544 173.5 206.99312656000257 53.5 406.99312656000257 53.5"
data-testid="r1"
stroke-width="1"
/>
Expand Down

0 comments on commit 8702e56

Please sign in to comment.