File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 241241 (entities db)
242242 (vals )))
243243
244+ (m/=> update-prop [:-> App uuid? ifn? [:* any?] App])
244245(defn update-prop
245246 [db id k & more]
246247 (-> (apply update-in db (path db id k) more)
295296 (assoc-attr db id k (string/trim (str v))))
296297 db)))
297298
299+ (m/=> update-attr [:-> App uuid? keyword? ifn? [:* any?] App])
298300(defn update-attr
299301 [db id k f & more]
300302 (if (utils.element/supported-attr? (entity db id) k)
817819 (= (:tag (entity db id)) :path )
818820 (update-attr id :d utils.path/manipulate action))))
819821
822+ (def SvgData [:map
823+ [:svg string?]
824+ [:label string?]
825+ [:position Vec2]])
826+
827+ (m/=> import-svg [:-> App SvgData App])
820828(defn import-svg
821- [db {:keys [svg label position]}]
822- (let [[x y] position
829+ [db data]
830+ (let [{:keys [svg label position]} data
831+ [x y] position
823832 hickory (hickory/as-hickory (hickory/parse svg))
824833 zipper (hickory.zip/hickory-zip hickory)
825834 svg (utils.hiccup/find-svg zipper)
Original file line number Diff line number Diff line change 22 (:require
33 [clojure.math.combinatorics :as combo]
44 [malli.core :as m]
5+ [renderer.app.db :refer [App]]
56 [renderer.document.db :refer [ZoomFactor]]
67 [renderer.frame.db :refer [Viewbox]]
78 [renderer.frame.handlers :as frame.handlers]
4243 (if (= orientation :vertical ) height width)
4344 ruler-step)))
4445
46+ (m/=> steps-intersections [:-> App [:sequential [:sequential number?]]])
4547(defn steps-intersections
4648 " Returns the intersection points of the rulers."
4749 [db]
You can’t perform that action at this time.
0 commit comments