mirror of
https://github.com/penpot/penpot.git
synced 2025-02-27 01:06:30 -05:00
🐛 Fixed problem with preview frames
This commit is contained in:
parent
68164102d1
commit
fc1e28a3d8
3 changed files with 13 additions and 5 deletions
|
@ -76,7 +76,7 @@
|
|||
(let [group-wrapper (mf/use-memo (mf/deps objects) #(group-wrapper objects))]
|
||||
(when (and shape (not (:hidden shape)))
|
||||
(let [shape (geom/transform-shape frame shape)
|
||||
opts #js {:shape shape :frame frame}]
|
||||
opts #js {:shape shape}]
|
||||
(case (:type shape)
|
||||
:curve [:> path/path-shape opts]
|
||||
:text [:> text/text-shape opts]
|
||||
|
@ -85,7 +85,7 @@
|
|||
:path [:> path/path-shape opts]
|
||||
:image [:> image/image-shape opts]
|
||||
:circle [:> circle/circle-shape opts]
|
||||
:group [:> group-wrapper opts]
|
||||
:group [:> group-wrapper {:shape shape :frame frame}]
|
||||
nil))))))
|
||||
|
||||
(mf/defc page-svg
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
frames (:frames data [])
|
||||
objects (:objects data)
|
||||
frame (get frames index)]
|
||||
|
||||
[:section.viewer-preview
|
||||
(cond
|
||||
(empty? frames)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
[uxbox.common.data :as d]
|
||||
[uxbox.main.store :as st]
|
||||
[uxbox.main.data.viewer :as dv]
|
||||
[uxbox.main.data.helpers :as helpers]
|
||||
[uxbox.main.ui.components.dropdown :refer [dropdown']]
|
||||
[uxbox.main.ui.shapes.frame :as frame]
|
||||
[uxbox.main.exports :as exports]
|
||||
|
@ -83,6 +84,14 @@
|
|||
(let [modifier (-> (gpt/point (:x frame) (:y frame))
|
||||
(gpt/negate)
|
||||
(gmt/translate-matrix))
|
||||
|
||||
frame-id (:id frame)
|
||||
modifier-ids (concat [frame-id] (helpers/get-children frame-id objects))
|
||||
|
||||
update-fn (fn [state shape-id]
|
||||
(-> state
|
||||
(assoc-in [shape-id :modifiers :displacement] modifier)))
|
||||
objects (reduce update-fn objects modifier-ids)
|
||||
frame (assoc-in frame [:modifiers :displacement] modifier )
|
||||
|
||||
width (* (:width frame) zoom)
|
||||
|
@ -96,9 +105,9 @@
|
|||
:height height
|
||||
:version "1.1"
|
||||
:xmlnsXlink "http://www.w3.org/1999/xlink"
|
||||
:xmlns "http://www.w3.org/2000/svg"}
|
||||
:xmlns "http://www.w3.org/2000/svg"}
|
||||
[:& frame-wrapper {:shape frame
|
||||
:view-box vbox}]]))
|
||||
:view-box vbox}]]))
|
||||
|
||||
(mf/defc thumbnails-summary
|
||||
[{:keys [on-toggle-expand on-close total] :as props}]
|
||||
|
|
Loading…
Add table
Reference in a new issue