From 5c468fe70867d3d252e407b55fd2ebc4fa49f460 Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Thu, 21 Jul 2022 14:57:12 +0800 Subject: [PATCH] fix: text smoothing & tldr assets --- src/main/frontend/components/whiteboard.cljs | 2 +- src/main/frontend/handler/whiteboard.cljs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/components/whiteboard.cljs b/src/main/frontend/components/whiteboard.cljs index 7a5c7582d..c0d41e029 100644 --- a/src/main/frontend/components/whiteboard.cljs +++ b/src/main/frontend/components/whiteboard.cljs @@ -87,7 +87,7 @@ ;; makes sure the whiteboard will not cover the borders {:key name - :style {:padding "0.5px" :z-index 0}} + :style {:padding "0.5px" :z-index 0 :transform "translateZ(0)" :text-rendering "geometricPrecision" :-webkit-font-smoothing "subpixel-antialiased"}} [:div.absolute.p-4.flex.items-start {:style {:z-index 2000}} diff --git a/src/main/frontend/handler/whiteboard.cljs b/src/main/frontend/handler/whiteboard.cljs index 9c643cd4d..c4d6aafef 100644 --- a/src/main/frontend/handler/whiteboard.cljs +++ b/src/main/frontend/handler/whiteboard.cljs @@ -61,8 +61,11 @@ (defn- whiteboard-clj->tldr [page-block blocks] (let [id (str (:block/uuid page-block)) shapes (map block->shape blocks) - page-properties (:block/properties page-block)] + page-properties (:block/properties page-block) + assets (:assets page-properties) + page-properties (dissoc page-properties :assets)] (clj->js {:currentPageId id + :assets assets :pages [(merge page-properties {:id id :name "page" @@ -76,8 +79,8 @@ (db-utils/entity [:block/name page-name])) (defn transact-tldr! [page-name tldr] - (let [{:keys [pages]} (js->clj tldr :keywordize-keys true) - tx (tldr-page->blocks-tx page-name (first pages))] + (let [{:keys [pages assets]} (js->clj tldr :keywordize-keys true) + tx (tldr-page->blocks-tx page-name (assoc (first pages) :assets assets))] (db-utils/transact! tx))) (defn set-linked-page-or-block!