mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 15:09:10 -05:00
🐛 Fix performance problem with new texts
This commit is contained in:
parent
a753037178
commit
ea7266dc3b
3 changed files with 9 additions and 8 deletions
|
@ -41,7 +41,8 @@
|
|||
|
||||
(mf/defc root-shape
|
||||
"Draws the root shape of the viewport and recursively all the shapes"
|
||||
{::mf/wrap-props false}
|
||||
{::mf/wrap [mf/memo]
|
||||
::mf/wrap-props false}
|
||||
[props]
|
||||
(let [objects (obj/get props "objects")
|
||||
active-frames (obj/get props "active-frames")
|
||||
|
|
|
@ -114,11 +114,10 @@
|
|||
(mf/deps all-children)
|
||||
(fn []
|
||||
(->> all-children
|
||||
(filter #(= :text (:type %)))
|
||||
(filter #(and (= :text (:type %)) (not (:hidden %))))
|
||||
(every? #(some? (:position-data %))))))
|
||||
|
||||
show-thumbnail?
|
||||
(and thumbnail? (some? (:thumbnail shape)) all-svg-text?)]
|
||||
show-thumbnail? (and thumbnail? (some? (:thumbnail shape)) all-svg-text?)]
|
||||
|
||||
[:g.frame-wrapper {:display (when (:hidden shape) "none")}
|
||||
[:> shape-container {:shape shape}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
(ns app.main.ui.workspace.viewport.utils
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.geom.matrix :as gmt]
|
||||
[app.common.geom.point :as gpt]
|
||||
[app.main.ui.cursors :as cur]
|
||||
|
@ -158,10 +159,10 @@
|
|||
(dom/remove-attribute node "transform")))))))
|
||||
|
||||
(defn format-viewbox [vbox]
|
||||
(str/join " " [(:x vbox 0)
|
||||
(:y vbox 0)
|
||||
(:width vbox 0)
|
||||
(:height vbox 0)]))
|
||||
(dm/str (:x vbox 0) " "
|
||||
(:y vbox 0) " "
|
||||
(:width vbox 0) " "
|
||||
(:height vbox 0)))
|
||||
|
||||
(defn translate-point-to-viewport [viewport zoom pt]
|
||||
(let [vbox (.. ^js viewport -viewBox -baseVal)
|
||||
|
|
Loading…
Add table
Reference in a new issue