mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
🐛 Fix problems with boards
This commit is contained in:
parent
e5b05eff23
commit
f004aa5efd
6 changed files with 42 additions and 30 deletions
|
@ -367,7 +367,7 @@
|
||||||
(comp first first))
|
(comp first first))
|
||||||
|
|
||||||
new-shapes
|
new-shapes
|
||||||
(into [] (sort-by #(or (id->idx %) -1) < old-shapes))]
|
(into [] (sort-by #(d/nilv (id->idx %) -1) < old-shapes))]
|
||||||
|
|
||||||
(reset! changed? (not= old-shapes new-shapes))
|
(reset! changed? (not= old-shapes new-shapes))
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,8 @@
|
||||||
|
|
||||||
prepare
|
prepare
|
||||||
(fn [shape-id]
|
(fn [shape-id]
|
||||||
(let [shape (get objects shape-id)]
|
(let [shape (get objects shape-id)
|
||||||
|
changes
|
||||||
(cond
|
(cond
|
||||||
(ctk/main-instance? shape)
|
(ctk/main-instance? shape)
|
||||||
(remove-component-changes it page-id shape objects file-data file)
|
(remove-component-changes it page-id shape objects file-data file)
|
||||||
|
@ -257,7 +258,11 @@
|
||||||
(remove-group-changes it page-id shape objects)
|
(remove-group-changes it page-id shape objects)
|
||||||
|
|
||||||
(cph/frame-shape? shape)
|
(cph/frame-shape? shape)
|
||||||
(remove-frame-changes it page-id shape objects))))
|
(remove-frame-changes it page-id shape objects))]
|
||||||
|
|
||||||
|
(cond-> changes
|
||||||
|
(ctl/grid-layout? objects (:parent-id shape))
|
||||||
|
(pcb/update-shapes [(:parent-id shape)] ctl/assign-cells))))
|
||||||
|
|
||||||
selected (wsh/lookup-selected state)
|
selected (wsh/lookup-selected state)
|
||||||
changes-list (sequence
|
changes-list (sequence
|
||||||
|
|
|
@ -444,7 +444,8 @@
|
||||||
[_ changes] (dwlh/generate-add-component-changes changes shape objects file-id (:id page) components-v2)]
|
[_ changes] (dwlh/generate-add-component-changes changes shape objects file-id (:id page) components-v2)]
|
||||||
changes))
|
changes))
|
||||||
|
|
||||||
new-obj (-> obj
|
new-obj
|
||||||
|
(-> obj
|
||||||
(assoc :id new-id
|
(assoc :id new-id
|
||||||
:name name
|
:name name
|
||||||
:parent-id parent-id
|
:parent-id parent-id
|
||||||
|
@ -462,7 +463,8 @@
|
||||||
(d/update-when :interactions #(ctsi/remap-interactions % ids-map objects))
|
(d/update-when :interactions #(ctsi/remap-interactions % ids-map objects))
|
||||||
|
|
||||||
(cond-> (ctl/grid-layout? obj)
|
(cond-> (ctl/grid-layout? obj)
|
||||||
(remap-grid-cells ids-map)))
|
(-> (ctl/check-deassigned-cells)
|
||||||
|
(remap-grid-cells ids-map))))
|
||||||
|
|
||||||
new-obj (cond-> new-obj
|
new-obj (cond-> new-obj
|
||||||
(not duplicating-component?)
|
(not duplicating-component?)
|
||||||
|
|
|
@ -52,8 +52,7 @@
|
||||||
(cond-> (some? cell)
|
(cond-> (some? cell)
|
||||||
(pcb/update-shapes [(:parent-id shape)] #(ctl/push-into-cell % [id] row column)))
|
(pcb/update-shapes [(:parent-id shape)] #(ctl/push-into-cell % [id] row column)))
|
||||||
(cond-> (ctl/grid-layout? objects (:parent-id shape))
|
(cond-> (ctl/grid-layout? objects (:parent-id shape))
|
||||||
(-> (pcb/update-shapes [(:parent-id shape)] ctl/assign-cells)
|
(pcb/update-shapes [(:parent-id shape)] ctl/assign-cells)))]
|
||||||
(pcb/reorder-grid-children [(:parent-id shape)]))))]
|
|
||||||
[shape changes]))
|
[shape changes]))
|
||||||
|
|
||||||
(defn add-shape
|
(defn add-shape
|
||||||
|
@ -403,7 +402,13 @@
|
||||||
(prepare-add-shape changes shape objects selected)
|
(prepare-add-shape changes shape objects selected)
|
||||||
|
|
||||||
changes
|
changes
|
||||||
(prepare-move-shapes-into-frame changes (:id shape) selected objects)]
|
(prepare-move-shapes-into-frame changes (:id shape) selected objects)
|
||||||
|
|
||||||
|
changes
|
||||||
|
(cond-> changes
|
||||||
|
(ctl/grid-layout? objects (:parent-id shape))
|
||||||
|
(-> (pcb/update-shapes [(:parent-id shape)] ctl/assign-cells)
|
||||||
|
(pcb/reorder-grid-children [(:parent-id shape)])))]
|
||||||
|
|
||||||
[shape changes]))))
|
[shape changes]))))
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{"button-primary":"sidebar_sitemap_button-primary_Z-bKW","button-secondary":"sidebar_sitemap_button-secondary_a56LZ","button-tertiary":"sidebar_sitemap_button-tertiary_E2hzd","sitemap":"sidebar_sitemap_sitemap_kvKKx","add-page":"sidebar_sitemap_add-page_r8Ibb","button-radio":"sidebar_sitemap_button-radio_BxzRJ","button-warning":"sidebar_sitemap_button-warning_qADPu","button-disabled":"sidebar_sitemap_button-disabled_IU-S6","button-tag":"sidebar_sitemap_button-tag_u1NAz","button-icon":"sidebar_sitemap_button-icon_MkibT","button-icon-small":"sidebar_sitemap_button-icon-small_Mhipv","tool-window-content":"sidebar_sitemap_tool-window-content_G-Nut","pages-list":"sidebar_sitemap_pages-list_cb1Mx","page-element":"sidebar_sitemap_page-element_iR9wf","element-list-body":"sidebar_sitemap_element-list-body_OIVac","page-actions":"sidebar_sitemap_page-actions_QTuKw","page-icon":"sidebar_sitemap_page-icon_ujSjM","link":"sidebar_sitemap_link_WvD4-","asset-element":"sidebar_sitemap_asset-element_I1-m4","input-element":"sidebar_sitemap_input-element_YAbpV","new-scrollbar":"sidebar_sitemap_new-scrollbar_Pb1-Y","menu-dropdown":"sidebar_sitemap_menu-dropdown_jAZ-g","menu-item":"sidebar_sitemap_menu-item_cQrV2","shortcut":"sidebar_sitemap_shortcut_Oywax","shortcut-key":"sidebar_sitemap_shortcut-key_IIYlf","user-icon":"sidebar_sitemap_user-icon_l-DH7","title-bar":"sidebar_sitemap_title-bar_tIJtT","title":"sidebar_sitemap_title_HmFc4","view-only-mode":"sidebar_sitemap_view-only-mode_JrsYg","resize-area":"sidebar_sitemap_resize-area_JgdjZ","dnd-over-top":"sidebar_sitemap_dnd-over-top_kGfcb","dnd-over-bot":"sidebar_sitemap_dnd-over-bot_352W2","dnd-over":"sidebar_sitemap_dnd-over_Sf5e2","page-name":"sidebar_sitemap_page-name_601Ii","element-name":"sidebar_sitemap_element-name_iMex0","on-drag":"sidebar_sitemap_on-drag_v3GM8","selected":"sidebar_sitemap_selected_mCOlT","hover":"sidebar_sitemap_hover_muWiS","hidden":"sidebar_sitemap_hidden_viFSn","title-spacing-sitemap":"sidebar_sitemap_title-spacing-sitemap_pDMgN","spin-animation":"sidebar_sitemap_spin-animation_SVOeo"}
|
|
@ -436,11 +436,11 @@
|
||||||
|
|
||||||
[width height]
|
[width height]
|
||||||
(if (= type :column)
|
(if (= type :column)
|
||||||
[(max 0 (- layout-gap-col (/ 10 zoom)) (/ 16 zoom))
|
[(max 0 (- layout-gap-col (/ 10 zoom)) (/ 8 zoom))
|
||||||
(+ row-total-size row-total-gap)]
|
(+ row-total-size row-total-gap)]
|
||||||
|
|
||||||
[(+ column-total-size column-total-gap)
|
[(+ column-total-size column-total-gap)
|
||||||
(max 0 (- layout-gap-row (/ 10 zoom)) (/ 16 zoom))])
|
(max 0 (- layout-gap-row (/ 10 zoom)) (/ 8 zoom))])
|
||||||
|
|
||||||
start-p
|
start-p
|
||||||
(cond-> start-p
|
(cond-> start-p
|
||||||
|
@ -471,7 +471,6 @@
|
||||||
(cur/get-dynamic "resize-ew" (:rotation shape))
|
(cur/get-dynamic "resize-ew" (:rotation shape))
|
||||||
(cur/get-dynamic "resize-ns" (:rotation shape)))
|
(cur/get-dynamic "resize-ns" (:rotation shape)))
|
||||||
:style {:fill "transparent"
|
:style {:fill "transparent"
|
||||||
:opacity 0.5
|
|
||||||
:stroke-width 0}}]))
|
:stroke-width 0}}]))
|
||||||
|
|
||||||
(mf/defc track-marker
|
(mf/defc track-marker
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue