0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

📚 Add some comments about possible code enhancements

This commit is contained in:
Andrés Moya 2021-07-16 15:25:22 +02:00
parent 6ced56301c
commit fa99dea8fe

View file

@ -1474,8 +1474,8 @@
(= :frame (get-in objects [(first selected) :type]))))) (= :frame (get-in objects [(first selected) :type])))))
(defn- paste-shape (defn- paste-shape
[{:keys [selected objects images] :as data} in-viewport?] [{:keys [selected objects images] :as data} in-viewport?] ;; TODO: perhaps rename 'objects' to 'shapes', because it contains only
(letfn [;; Given a file-id and img (part generated by the (letfn [;; Given a file-id and img (part generated by the ;; the shapes to paste, not the whole page tree of shapes
;; copy-selected event), uploads the new media. ;; copy-selected event), uploads the new media.
(upload-media [file-id imgpart] (upload-media [file-id imgpart]
(->> (http/send! {:uri (:file-data imgpart) (->> (http/send! {:uri (:file-data imgpart)
@ -1583,7 +1583,7 @@
page-id (:current-page-id state) page-id (:current-page-id state)
unames (-> (wsh/lookup-page-objects state page-id) unames (-> (wsh/lookup-page-objects state page-id)
(dwc/retrieve-used-names)) (dwc/retrieve-used-names)) ;; TODO: move this calculation inside prepare-duplcate-changes?
rchanges (->> (dws/prepare-duplicate-changes objects page-id unames selected delta) rchanges (->> (dws/prepare-duplicate-changes objects page-id unames selected delta)
(mapv (partial process-rchange media-idx)) (mapv (partial process-rchange media-idx))