From b960beb2f31327becdf6709a61b90523abdee65a Mon Sep 17 00:00:00 2001 From: Sophie Zhang Date: Thu, 22 Feb 2024 13:39:42 -0500 Subject: layout progress --- .../collectionFreeForm/CollectionFreeFormView.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 1e0840495..19948b7eb 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1649,15 +1649,22 @@ export class CollectionFreeFormView extends CollectionSubView {}; + + roundToRoundNumber = (num: number) => { + return Math.round(num / 10) * 10; + }; + // gpt layout @action gptLayout = async () => { const docLayouts = this.childDocs.map(doc => ({ - width: NumCast(doc.width), - height: NumCast(doc.height), - content: StrCast(doc.title), + width: this.roundToRoundNumber(NumCast(doc.width)), + height: this.roundToRoundNumber(NumCast(doc.height)), + // content: StrCast(doc.title), })); - console.log(docLayouts); + console.log('Doc layouts', docLayouts); const res = await smartLayout2(docLayouts); console.log('Smart layout result', res); @@ -1752,6 +1759,7 @@ export class CollectionFreeFormView extends CollectionSubView