From 75254dbe3512e3507e34481e75bb60e7760a946f Mon Sep 17 00:00:00 2001
From: Melissa Zhang <mzhang19096@gmail.com>
Date: Mon, 18 May 2020 00:59:32 -0700
Subject: fit ContentFittingViews into main/prev/next panels

---
 src/client/views/collections/CollectionCarousel3DView.tsx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'src/client/views/collections/CollectionCarousel3DView.tsx')

diff --git a/src/client/views/collections/CollectionCarousel3DView.tsx b/src/client/views/collections/CollectionCarousel3DView.tsx
index 4452ceb6b..c2ed39cc9 100644
--- a/src/client/views/collections/CollectionCarousel3DView.tsx
+++ b/src/client/views/collections/CollectionCarousel3DView.tsx
@@ -40,6 +40,10 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
         this.layoutDoc._itemIndex = (NumCast(this.layoutDoc._itemIndex) - 1 + this.childLayoutPairs.length) % this.childLayoutPairs.length;
     }
 
+    mainPanelWidth = () => this.props.PanelWidth() * 0.6;
+    sidePanelWidth = () => this.props.PanelWidth() * 0.3;
+    sidePanelHeight = () => this.props.PanelHeight() * 0.5;
+
     @computed get content() {
         const index = NumCast(this.layoutDoc._itemIndex);
         const prevIndex = (index - 1 + this.childLayoutPairs.length) % this.childLayoutPairs.length;
@@ -55,7 +59,8 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
                         LayoutTemplateString={this.props.ChildLayoutString}
                         Document={this.childLayoutPairs[prevIndex].layout}
                         DataDoc={this.childLayoutPairs[prevIndex].data}
-                        PanelHeight={this.props.PanelHeight}
+                        PanelWidth={this.sidePanelWidth}
+                        PanelHeight={this.sidePanelHeight}
                         ScreenToLocalTransform={this.props.ScreenToLocalTransform}
                         bringToFront={returnFalse}
                         parentActive={this.props.active}
@@ -70,7 +75,8 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
                         LayoutTemplateString={this.props.ChildLayoutString}
                         Document={this.childLayoutPairs[nextIndex].layout}
                         DataDoc={this.childLayoutPairs[nextIndex].data}
-                        PanelHeight={this.props.PanelHeight}
+                        PanelWidth={this.sidePanelWidth}
+                        PanelHeight={this.sidePanelHeight}
                         ScreenToLocalTransform={this.props.ScreenToLocalTransform}
                         bringToFront={returnFalse}
                         parentActive={this.props.active}
@@ -85,6 +91,7 @@ export class CollectionCarousel3DView extends CollectionSubView(Carousel3DDocume
                         LayoutTemplateString={this.props.ChildLayoutString}
                         Document={this.childLayoutPairs[index].layout}
                         DataDoc={this.childLayoutPairs[index].data}
+                        PanelWidth={this.mainPanelWidth}
                         PanelHeight={this.props.PanelHeight}
                         ScreenToLocalTransform={this.props.ScreenToLocalTransform}
                         bringToFront={returnFalse}
-- 
cgit v1.2.3-70-g09d2

