🐛 Synchronize well al color and special attributes

This commit is contained in:
Andrés Moya 2020-12-04 10:39:35 +01:00 committed by Andrey Antukh
parent e9714c4fd0
commit 976dab90c8
2 changed files with 25 additions and 23 deletions

View file

@ -217,7 +217,7 @@
(s/def :internal.shape/fill-color string?) (s/def :internal.shape/fill-color string?)
(s/def :internal.shape/fill-opacity ::safe-number) (s/def :internal.shape/fill-opacity ::safe-number)
(s/def :internal.shape/fill-gradient (s/nilable ::gradient)) (s/def :internal.shape/fill-color-gradient (s/nilable ::gradient))
(s/def :internal.shape/fill-color-ref-file (s/nilable uuid?)) (s/def :internal.shape/fill-color-ref-file (s/nilable uuid?))
(s/def :internal.shape/fill-color-ref-id (s/nilable uuid?)) (s/def :internal.shape/fill-color-ref-id (s/nilable uuid?))
@ -235,6 +235,7 @@
(s/def :internal.shape/rx ::safe-number) (s/def :internal.shape/rx ::safe-number)
(s/def :internal.shape/ry ::safe-number) (s/def :internal.shape/ry ::safe-number)
(s/def :internal.shape/stroke-color string?) (s/def :internal.shape/stroke-color string?)
(s/def :internal.shape/stroke-color-gradient (s/nilable ::gradient))
(s/def :internal.shape/stroke-color-ref-file (s/nilable uuid?)) (s/def :internal.shape/stroke-color-ref-file (s/nilable uuid?))
(s/def :internal.shape/stroke-color-ref-id (s/nilable uuid?)) (s/def :internal.shape/stroke-color-ref-id (s/nilable uuid?))
(s/def :internal.shape/stroke-opacity ::safe-number) (s/def :internal.shape/stroke-opacity ::safe-number)
@ -293,9 +294,10 @@
:internal.shape/collapsed :internal.shape/collapsed
:internal.shape/content :internal.shape/content
:internal.shape/fill-color :internal.shape/fill-color
:internal.shape/fill-opacity
:internal.shape/fill-color-gradient
:internal.shape/fill-color-ref-file :internal.shape/fill-color-ref-file
:internal.shape/fill-color-ref-id :internal.shape/fill-color-ref-id
:internal.shape/fill-opacity
:internal.shape/font-family :internal.shape/font-family
:internal.shape/font-size :internal.shape/font-size
:internal.shape/font-style :internal.shape/font-style
@ -330,9 +332,10 @@
:internal.shape/blur])) :internal.shape/blur]))
(def component-sync-attrs {:fill-color :fill-group (def component-sync-attrs {:fill-color :fill-group
:fill-opacity :fill-group
:fill-color-gradient :fill-group
:fill-color-ref-file :fill-group :fill-color-ref-file :fill-group
:fill-color-ref-id :fill-group :fill-color-ref-id :fill-group
:fill-opacity :fill-group
:content :content-group :content :content-group
:font-family :text-font-group :font-family :text-font-group
:font-size :text-font-group :font-size :text-font-group
@ -342,6 +345,7 @@
:line-height :text-display-group :line-height :text-display-group
:text-align :text-display-group :text-align :text-display-group
:stroke-color :stroke-group :stroke-color :stroke-group
:stroke-color-gradient :stroke-group
:stroke-color-ref-file :stroke-group :stroke-color-ref-file :stroke-group
:stroke-color-ref-id :stroke-group :stroke-color-ref-id :stroke-group
:stroke-opacity :stroke-group :stroke-opacity :stroke-group
@ -361,6 +365,8 @@
:height :geometry-group :height :geometry-group
:transform :geometry-group :transform :geometry-group
:transform-inverse :geometry-group :transform-inverse :geometry-group
:shadow :shadow-group
:blur :blur-group
:masked-group? :mask-group}) :masked-group? :mask-group})
;; shapes-group is handled differently ;; shapes-group is handled differently

View file

@ -1013,10 +1013,6 @@
(assoc $ :component-id (:id container))))]] (assoc $ :component-id (:id container))))]]
[rchanges uchanges]) [rchanges uchanges])
(if-not (contains? dest-shape attr)
(recur (next attrs)
roperations
uoperations)
(let [roperation {:type :set (let [roperation {:type :set
:attr attr :attr attr
:val (get origin-shape attr) :val (get origin-shape attr)
@ -1033,7 +1029,7 @@
uoperations) uoperations)
(recur (next attrs) (recur (next attrs)
(conj roperations roperation) (conj roperations roperation)
(conj uoperations uoperation)))))))))) (conj uoperations uoperation)))))))))
(defn- reposition-shape (defn- reposition-shape
[shape origin-root dest-root] [shape origin-root dest-root]