mirror of
https://github.com/penpot/penpot.git
synced 2026-08-28 23:59:00 +00:00
🐛 Fix problem when exporting single text
This commit is contained in:
parent
82d744b94a
commit
8df93c2707
@ -402,7 +402,7 @@
|
|||||||
:style {:-webkit-print-color-adjust :exact}
|
:style {:-webkit-print-color-adjust :exact}
|
||||||
:fill "none"}
|
:fill "none"}
|
||||||
|
|
||||||
(let [fonts (ff/frame->fonts object objects)]
|
(let [fonts (ff/shape->fonts object objects)]
|
||||||
[:& ff/fontfaces-style {:fonts fonts}])
|
[:& ff/fontfaces-style {:fonts fonts}])
|
||||||
|
|
||||||
(case (:type object)
|
(case (:type object)
|
||||||
|
|||||||
@ -73,12 +73,15 @@
|
|||||||
(when (d/not-empty? style)
|
(when (d/not-empty? style)
|
||||||
[:style style])))
|
[:style style])))
|
||||||
|
|
||||||
(defn frame->fonts
|
(defn shape->fonts
|
||||||
[frame objects]
|
[shape objects]
|
||||||
(->> (cph/get-children objects (:id frame))
|
(let [initial (cond-> #{}
|
||||||
(filter cph/text-shape?)
|
(cph/text-shape? shape)
|
||||||
(map (comp fonts/get-content-fonts :content))
|
(into (fonts/get-content-fonts (:content shape))))]
|
||||||
(reduce set/union #{})))
|
(->> (cph/get-children objects (:id shape))
|
||||||
|
(filter cph/text-shape?)
|
||||||
|
(map (comp fonts/get-content-fonts :content))
|
||||||
|
(reduce set/union initial))))
|
||||||
|
|
||||||
(defn shapes->fonts
|
(defn shapes->fonts
|
||||||
[shapes]
|
[shapes]
|
||||||
|
|||||||
@ -61,7 +61,7 @@
|
|||||||
thumbnail? (unchecked-get props "thumbnail?")
|
thumbnail? (unchecked-get props "thumbnail?")
|
||||||
objects (unchecked-get props "objects")
|
objects (unchecked-get props "objects")
|
||||||
|
|
||||||
fonts (mf/use-memo (mf/deps shape objects) #(ff/frame->fonts shape objects))
|
fonts (mf/use-memo (mf/deps shape objects) #(ff/shape->fonts shape objects))
|
||||||
fonts (-> fonts (hooks/use-equal-memo))
|
fonts (-> fonts (hooks/use-equal-memo))
|
||||||
|
|
||||||
force-render (mf/use-state false)
|
force-render (mf/use-state false)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user