mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Merge pull request #7907 from penpot/alotor-fix-export-text
🐛 Fix problem when exporting texts
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
(def current-zoom (mf/create-context nil))
|
(def current-zoom (mf/create-context nil))
|
||||||
|
|
||||||
(def workspace-read-only? (mf/create-context nil))
|
(def workspace-read-only? (mf/create-context nil))
|
||||||
|
(def is-render? (mf/create-context false))
|
||||||
(def is-component? (mf/create-context false))
|
(def is-component? (mf/create-context false))
|
||||||
|
|
||||||
(def sidebar
|
(def sidebar
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[props]
|
[props]
|
||||||
(let [{:keys [position-data content] :as shape} (obj/get props "shape")
|
(let [{:keys [position-data content] :as shape} (obj/get props "shape")
|
||||||
|
is-render? (mf/use-ctx ctx/is-render?)
|
||||||
is-component? (mf/use-ctx ctx/is-component?)]
|
is-component? (mf/use-ctx ctx/is-component?)]
|
||||||
|
|
||||||
(mf/with-memo [content]
|
(mf/with-memo [content]
|
||||||
@@ -41,5 +42,5 @@
|
|||||||
;; Only use this for component preview, otherwise the dashboard thumbnails
|
;; Only use this for component preview, otherwise the dashboard thumbnails
|
||||||
;; will give a tainted canvas error because the `foreignObject` cannot be
|
;; will give a tainted canvas error because the `foreignObject` cannot be
|
||||||
;; rendered.
|
;; rendered.
|
||||||
(and (nil? position-data) is-component?)
|
(and (nil? position-data) (or is-component? is-render?))
|
||||||
[:> fo/text-shape props])))
|
[:> fo/text-shape props])))
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
[app.main.render :as render]
|
[app.main.render :as render]
|
||||||
[app.main.repo :as repo]
|
[app.main.repo :as repo]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
|
[app.main.ui.context :as ctx]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.globals :as glob]
|
[app.util.globals :as glob]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
@@ -76,11 +77,12 @@
|
|||||||
(mth/ceil height) "px")}))))
|
(mth/ceil height) "px")}))))
|
||||||
|
|
||||||
(when objects
|
(when objects
|
||||||
|
[:& (mf/provider ctx/is-render?) {:value true}
|
||||||
[:& render/object-svg
|
[:& render/object-svg
|
||||||
{:objects objects
|
{:objects objects
|
||||||
:object-id object-id
|
:object-id object-id
|
||||||
:embed embed
|
:embed embed
|
||||||
:skip-children skip-children}])))
|
:skip-children skip-children}]])))
|
||||||
|
|
||||||
(mf/defc objects-svg
|
(mf/defc objects-svg
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
@@ -88,12 +90,13 @@
|
|||||||
(when-let [objects (mf/deref ref:objects)]
|
(when-let [objects (mf/deref ref:objects)]
|
||||||
(for [object-id object-ids]
|
(for [object-id object-ids]
|
||||||
(let [objects (render/adapt-objects-for-shape objects object-id)]
|
(let [objects (render/adapt-objects-for-shape objects object-id)]
|
||||||
|
[:& (mf/provider ctx/is-render?) {:value true}
|
||||||
[:& render/object-svg
|
[:& render/object-svg
|
||||||
{:objects objects
|
{:objects objects
|
||||||
:key (str object-id)
|
:key (str object-id)
|
||||||
:object-id object-id
|
:object-id object-id
|
||||||
:embed embed
|
:embed embed
|
||||||
:skip-children skip-children}]))))
|
:skip-children skip-children}]]))))
|
||||||
|
|
||||||
(defn- fetch-objects-bundle
|
(defn- fetch-objects-bundle
|
||||||
[& {:keys [file-id page-id share-id object-id] :as options}]
|
[& {:keys [file-id page-id share-id object-id] :as options}]
|
||||||
|
|||||||
Reference in New Issue
Block a user