diff --git a/src/uxbox/ui/shapes/core.cljs b/src/uxbox/ui/shapes/core.cljs index ce3312b284..9b04bc2508 100644 --- a/src/uxbox/ui/shapes/core.cljs +++ b/src/uxbox/ui/shapes/core.cljs @@ -63,19 +63,29 @@ [attrs] (if-let [type (:stroke-type attrs)] (let [value (case type - :dotted "1,1" - :dashed "10,10")] - (-> attrs - (assoc! :stroke-dasharray value) - (dissoc! :stroke-type))) + :mixed "5,5,1,5" + :dotted "5,5" + :dashed "10,10" + nil)] + (if value + (-> attrs + (assoc! :stroke-dasharray value) + (dissoc! :stroke-type)) + (dissoc! attrs :stroke-type))) attrs)) +(defn- transform-stroke-attrs + [attrs] + (if (= (:stroke-type attrs :none) :none) + (dissoc! attrs :stroke-type :stroke-width :stroke-opacity :stroke) + (transform-stroke-type attrs))) + (defn- extract-style-attrs "Extract predefinet attrs from shapes." [shape] (let [attrs (select-keys shape +style-attrs+)] (-> (transient attrs) - (transform-stroke-type) + (transform-stroke-attrs) (persistent!)))) (defn- make-debug-attrs diff --git a/src/uxbox/ui/workspace/sidebar/options.cljs b/src/uxbox/ui/workspace/sidebar/options.cljs index c690fac51e..3168fc0740 100644 --- a/src/uxbox/ui/workspace/sidebar/options.cljs +++ b/src/uxbox/ui/workspace/sidebar/options.cljs @@ -88,16 +88,18 @@ [:span "Style"] [:div.row-flex [:select#style.input-select {:placeholder "Style" - :on-change on-stroke-style-change} - [:option {:value "nil"} "None"] - [:option {:value "nil"} "Solid"] + :value (:stroke-type shape) + :on-change on-stroke-style-change} + [:option {:value ":none"} "None"] + [:option {:value ":solid"} "Solid"] [:option {:value ":dotted"} "Dotted"] - [:option {:value ":dashed"} "Dashed"]] + [:option {:value ":dashed"} "Dashed"] + [:option {:value ":mixed"} "Mixed"]] [:input#width.input-text {:placeholder "Width" :type "number" :min "0" - :value (:stroke-width shape "") + :value (:stroke-width shape "1") :on-change on-width-change}]] ;; SLIDEBAR FOR ROTATION AND OPACITY