Small fixes for flex layout

This commit is contained in:
alonso.torres 2022-11-07 18:21:36 +01:00
parent e61e76a074
commit cdaba395c4
10 changed files with 11 additions and 40 deletions

View file

@ -16,6 +16,7 @@
[app.common.types.shape :as cts]
[app.common.types.shape-tree :as ctst]
[app.common.types.shape.interactions :as ctsi]
[app.common.types.shape.layout :as ctl]
[app.common.uuid :as uuid]
[app.main.data.comments :as dc]
[app.main.data.workspace.changes :as dch]
@ -148,7 +149,7 @@
layout-ids (->> ids
(mapcat (partial cph/get-parent-ids objects))
(filter (partial cph/layout-shape? objects)))
(filter (partial ctl/layout? objects)))
components-v2 (features/active-feature? state :components-v2)

View file

@ -81,9 +81,7 @@
[{:keys [shape] :as props}]
(let [render-thumbnails? (mf/use-ctx muc/render-thumbnails)
childs (mapv #(get objects %) (:shapes shape))
;;shape (gsh/transform-shape shape)
]
childs (mapv #(get objects %) (:shapes shape))]
(if (and render-thumbnails? (some? (:thumbnail shape)))
[:& frame/frame-thumbnail {:shape shape :bounds (:children-bounds shape)}]
[:& frame-shape {:shape shape :childs childs}])))))
@ -136,8 +134,7 @@
bool-wrapper (mf/use-memo (mf/deps objects) #(bool-wrapper-factory objects))
frame-wrapper (mf/use-memo (mf/deps objects) #(frame-wrapper-factory objects))]
(when (and shape (not (:hidden shape)))
(let [;;shape (gsh/transform-shape shape)
opts #js {:shape shape}
(let [opts #js {:shape shape}
svg-raw? (= :svg-raw (:type shape))]
(if-not svg-raw?
[:> shape-container {:shape shape}
@ -167,9 +164,7 @@
[objects object]
(let [shapes (cph/get-immediate-children objects)
srect (gsh/selection-rect shapes)
object (merge object (select-keys srect [:x :y :width :height]))
;; object (gsh/transform-shape object)
]
object (merge object (select-keys srect [:x :y :width :height]))]
(assoc object :fill-color "#f0f0f0")))
(defn adapt-objects-for-shape

View file

@ -88,8 +88,6 @@
[props]
(let [shape (unchecked-get props "shape")
childs (mapv #(get objects %) (:shapes shape))
;;shape (gsh/transform-shape shape)
props (-> (obj/create)
(obj/merge! props)
(obj/merge! #js {:shape shape

View file

@ -350,7 +350,6 @@
[props]
(let [shape (obj/get props "shape")
childs (mapv #(get objects %) (:shapes shape))
;;shape (gsh/transform-shape shape)
props (obj/merge! #js {} props
#js {:shape shape
:childs childs

View file

@ -341,7 +341,6 @@
(let [shape (mf/use-memo
(mf/deps shapes)
#(->> shapes
#_(map gsh/transform-shape)
(gsh/selection-rect)
(cts/setup-shape)))
on-resize
@ -369,7 +368,6 @@
(let [shape (mf/use-memo
(mf/deps shapes)
#(->> shapes
#_(map gsh/transform-shape)
(gsh/selection-rect)
(cts/setup-shape)))]
@ -384,7 +382,6 @@
(mf/defc single-handlers
[{:keys [shape zoom color disable-handlers] :as props}]
(let [shape-id (:id shape)
;;shape (gsh/transform-shape shape)
on-resize
(fn [current-position _initial-position event]