Skip to content

Commit

Permalink
temporal fix for galleries
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloose committed Dec 2, 2024
1 parent fb7d370 commit 8390b22
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 6 additions & 2 deletions app/src/pages/Editor/components/blocks/PictureSlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ export const PictureSlot = memo(({ idRef, v, res, props }: PictureSlotProps) =>
imgOffsetY = frameHeight / 2 - imgHeight / 2;
}

// const changedX = -pos[0] + (pos[0] > 0 ? frameWidth : -frameWidth);
// const changedX = -pos[0] - frameWidth;
const changedX = pos[0];

return (
<Group>
{ /* Base color and border */}
<Rect
x={-pos[0] - frameWidth}
x={changedX}
y={pos[1]}
width={frameWidth}
height={frameHeight}
Expand Down Expand Up @@ -132,7 +136,7 @@ export const PictureSlot = memo(({ idRef, v, res, props }: PictureSlotProps) =>
{ /* Rendered image */}
{
image && <Image
x={-pos[0] - frameWidth - imgOffsetY * sine(rotation) + imgOffsetX * cosine(rotation)}
x={changedX - imgOffsetY * sine(rotation) + imgOffsetX * cosine(rotation)}
y={pos[1] + imgOffsetY * cosine(rotation) + imgOffsetX * sine(rotation)}
width={imgWidth}
height={imgHeight}
Expand Down
14 changes: 9 additions & 5 deletions app/src/pages/Gallery3D/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ export const Gallery3D = ({ gallery, withTopOffset }: Gallery3DProps) => {
</>
)
}
<Button size='compact-sm' onClick={() => toggle()} style={{ height: 32, position: 'absolute', zIndex: 69, top: withTopOffset ? 78 : 8, left: 8 }}>
{
fullscreen ? <IconMaximizeOff /> : <IconMaximize />
}
</Button>
{
!loading && (
<Button size='compact-sm' onClick={() => toggle()} style={{ height: 32, position: 'absolute', zIndex: 69, top: withTopOffset ? 78 : 8, left: 8 }}>
{
fullscreen ? <IconMaximizeOff /> : <IconMaximize />
}
</Button>
)
}
<Canvas
camera={{ fov: 70 }}
onPointerDown={(e) => {
Expand Down

0 comments on commit 8390b22

Please sign in to comment.