Skip to content

Commit

Permalink
fix(app): labware render viewbox adjustment (#13570)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader authored Sep 15, 2023
1 parent a2aa090 commit 38140b1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/src/organisms/LabwareDetails/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ export interface GalleryProps {

export function Gallery(props: GalleryProps): JSX.Element {
const { definition } = props
const { parameters: params, dimensions: dims } = definition
const {
parameters: params,
dimensions: dims,
cornerOffsetFromSlot,
} = definition
const [currentImage, setCurrentImage] = React.useState<number>(0)
const render = (
<Box width="100%">
<RobotWorkSpace
key="center"
viewBox={`0 0 ${String(dims.xDimension)} ${String(dims.yDimension)}`}
viewBox={`${cornerOffsetFromSlot.x} ${cornerOffsetFromSlot.y} ${dims.xDimension} ${dims.yDimension}`}
>
{() => <LabwareRender definition={definition} />}
</RobotWorkSpace>
Expand Down

0 comments on commit 38140b1

Please sign in to comment.