0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

Make opaque masks by default

This commit is contained in:
Andrés Moya 2020-10-20 10:55:34 +02:00 committed by Alonso Torres
parent ccba95f541
commit b2ec9aa83a

View file

@ -1464,7 +1464,31 @@
:id (:id group)
:operations [{:type :set
:attr :masked-group?
:val nil}]})]
:val nil}]})
;; If the mask has the default color, change it automatically
;; to white, to have an opaque mask by default (user may change
;; it later to have different degrees of transparency).
mask (first shapes)
rchanges (if (not= (:fill-color mask) cp/default-color)
rchanges
(conj rchanges
{:type :mod-obj
:page-id page-id
:id (:id mask)
:operations [{:type :set
:attr :fill-color
:val "#ffffff"}]}))
uchanges (if (not= (:fill-color mask) cp/default-color)
uchanges
(conj uchanges
{:type :mod-obj
:page-id page-id
:id (:id mask)
:operations [{:type :set
:attr :fill-color
:val (:fill-color mask)}]}))]
(rx/of (dwc/commit-changes rchanges uchanges {:commit-local? true})
(dws/select-shapes (d/ordered-set (:id group))))))))))