mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🐛 Flix blend mode validation when importing svg
This commit is contained in:
parent
55a821f193
commit
1d5d5e2499
2 changed files with 5 additions and 6 deletions
|
@ -30,7 +30,7 @@
|
|||
(def stroke-caps-marker #{:line-arrow :triangle-arrow :square-marker :circle-marker :diamond-marker})
|
||||
(def stroke-caps (set/union stroke-caps-line stroke-caps-marker))
|
||||
|
||||
(def blend-mode
|
||||
(def blend-modes
|
||||
#{:normal
|
||||
:darken
|
||||
:multiply
|
||||
|
@ -139,7 +139,7 @@
|
|||
[:vector {:gen/max 2} ::stroke]]
|
||||
[:transform {:optional true} ::gmt/matrix]
|
||||
[:transform-inverse {:optional true} ::gmt/matrix]
|
||||
[:blend-mode {:optional true} [::sm/one-of blend-mode]]
|
||||
[:blend-mode {:optional true} [::sm/one-of blend-modes]]
|
||||
[:interactions {:optional true}
|
||||
[:vector {:gen/max 2} ::ctsi/interaction]]
|
||||
[:shadow {:optional true}
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
[app.util.svg :as usvg]
|
||||
[app.util.webapi :as wapi]
|
||||
[beicon.core :as rx]
|
||||
[clojure.spec.alpha :as s]
|
||||
[cuerdas.core :as str]
|
||||
[potok.core :as ptk]))
|
||||
|
||||
|
@ -67,10 +66,10 @@
|
|||
str/trim
|
||||
str/lower
|
||||
keyword)]
|
||||
(when-not (s/valid? ::cts/blend-mode clean-value)
|
||||
(when-not (contains? cts/blend-modes clean-value)
|
||||
(ex/raise :type :assertion
|
||||
:code :expr-validation
|
||||
:hint (str/ffmt "%1 is not a valid blend mode" clean-value)))
|
||||
:code :expr-validation
|
||||
:hint (str/ffmt "%1 is not a valid blend mode" clean-value)))
|
||||
clean-value))
|
||||
|
||||
(defn- svg-dimensions [data]
|
||||
|
|
Loading…
Add table
Reference in a new issue