0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-12 07:41:43 -05:00

🐛 Fix problems with boards

This commit is contained in:
alonso.torres 2023-09-20 13:29:23 +02:00 committed by Andrey Antukh
parent e5b05eff23
commit f004aa5efd
6 changed files with 42 additions and 30 deletions

View file

@ -367,7 +367,7 @@
(comp first first))
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))

View file

@ -248,16 +248,21 @@
prepare
(fn [shape-id]
(let [shape (get objects shape-id)]
(cond
(ctk/main-instance? shape)
(remove-component-changes it page-id shape objects file-data file)
(let [shape (get objects shape-id)
changes
(cond
(ctk/main-instance? shape)
(remove-component-changes it page-id shape objects file-data file)
(or (cph/group-shape? shape) (cph/bool-shape? shape))
(remove-group-changes it page-id shape objects)
(or (cph/group-shape? shape) (cph/bool-shape? shape))
(remove-group-changes it page-id shape objects)
(cph/frame-shape? shape)
(remove-frame-changes it page-id shape objects))))
(cph/frame-shape? shape)
(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)
changes-list (sequence

View file

@ -444,25 +444,27 @@
[_ changes] (dwlh/generate-add-component-changes changes shape objects file-id (:id page) components-v2)]
changes))
new-obj (-> obj
(assoc :id new-id
:name name
:parent-id parent-id
:frame-id frame-id)
new-obj
(-> obj
(assoc :id new-id
:name name
:parent-id parent-id
:frame-id frame-id)
(dissoc :shapes
:main-instance
:use-for-thumbnail)
(dissoc :shapes
:main-instance
:use-for-thumbnail)
(cond->
(or frame? group? bool?)
(assoc :shapes []))
(cond->
(or frame? group? bool?)
(assoc :shapes []))
(gsh/move delta)
(d/update-when :interactions #(ctsi/remap-interactions % ids-map objects))
(gsh/move delta)
(d/update-when :interactions #(ctsi/remap-interactions % ids-map objects))
(cond-> (ctl/grid-layout? obj)
(remap-grid-cells ids-map)))
(cond-> (ctl/grid-layout? obj)
(-> (ctl/check-deassigned-cells)
(remap-grid-cells ids-map))))
new-obj (cond-> new-obj
(not duplicating-component?)

View file

@ -52,8 +52,7 @@
(cond-> (some? cell)
(pcb/update-shapes [(:parent-id shape)] #(ctl/push-into-cell % [id] row column)))
(cond-> (ctl/grid-layout? objects (:parent-id shape))
(-> (pcb/update-shapes [(:parent-id shape)] ctl/assign-cells)
(pcb/reorder-grid-children [(:parent-id shape)]))))]
(pcb/update-shapes [(:parent-id shape)] ctl/assign-cells)))]
[shape changes]))
(defn add-shape
@ -403,7 +402,13 @@
(prepare-add-shape changes shape objects selected)
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]))))

View file

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

View file

@ -436,11 +436,11 @@
[width height]
(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)]
[(+ 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
(cond-> start-p
@ -471,7 +471,6 @@
(cur/get-dynamic "resize-ew" (:rotation shape))
(cur/get-dynamic "resize-ns" (:rotation shape)))
:style {:fill "transparent"
:opacity 0.5
:stroke-width 0}}]))
(mf/defc track-marker