0
Fork 0
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:
alonso.torres 2022-03-24 13:48:06 +01:00 committed by Andrey Antukh
parent a753037178
commit ea7266dc3b
3 changed files with 9 additions and 8 deletions

View file

@ -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")

View file

@ -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}

View file

@ -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)