0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-13 16:21:57 -05:00

🐛 Fixes problem when changing type

This commit is contained in:
alonso.torres 2020-05-20 11:47:40 +02:00
parent bcd755c9e4
commit 6ebce57abc
2 changed files with 6 additions and 2 deletions

View file

@ -67,7 +67,9 @@
(fn [type]
(let [defaults (type default-grid-params)
keys (keys defaults)
params (->> @state :changes params (select-keys keys) (merge defaults))
current-changes (-> @state :changes :params (select-keys keys))
;; We give more priority to the current changes
params (merge defaults current-changes)
to-merge {:type type :params params}]
(emit-changes! #(d/deep-merge % to-merge))))

View file

@ -31,7 +31,9 @@
(defn hex->rgb
[v]
(into [] (gcolor/hexToRgb v)))
(try
(into [] (gcolor/hexToRgb v))
(catch js/Object e [0 0 0])))
(defn rgb->hex
[[r g b]]