diff --git a/common/src/app/common/geom/matrix.cljc b/common/src/app/common/geom/matrix.cljc index 40cd8d2764..b8e0bf19e5 100644 --- a/common/src/app/common/geom/matrix.cljc +++ b/common/src/app/common/geom/matrix.cljc @@ -26,7 +26,7 @@ (toString [_] (str "matrix(" a "," b "," c "," d "," e "," f ")"))) -(defn ^boolean matrix? +(defn matrix? "Return true if `v` is Matrix instance." [v] (instance? Matrix v)) @@ -120,7 +120,7 @@ ([{x :x y :y :as pt}] (assert (gpt/point? pt)) (Matrix. 1 0 0 1 x y)) - + ([x y] (translate-matrix (gpt/point x y)))) diff --git a/common/src/app/common/geom/point.cljc b/common/src/app/common/geom/point.cljc index 78c3771519..9472fdce39 100644 --- a/common/src/app/common/geom/point.cljc +++ b/common/src/app/common/geom/point.cljc @@ -21,7 +21,7 @@ (defn s [{:keys [x y]}] (str "(" x "," y ")")) -(defn ^boolean point? +(defn point? "Return true if `v` is Point instance." [v] (or (instance? Point v) @@ -33,7 +33,7 @@ (s/def ::point (s/and (s/keys :req-un [::x ::y]) point?)) -(defn ^boolean point-like? +(defn point-like? [{:keys [x y] :as v}] (and (map? v) (not (nil? x)) diff --git a/common/src/app/common/pages/helpers.cljc b/common/src/app/common/pages/helpers.cljc index 39d881c532..b042d1c2dc 100644 --- a/common/src/app/common/pages/helpers.cljc +++ b/common/src/app/common/pages/helpers.cljc @@ -17,28 +17,28 @@ ;; GENERIC SHAPE SELECTORS AND PREDICATES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defn ^boolean root-frame? +(defn root-frame? [{:keys [id type]}] (and (= type :frame) (= id uuid/zero))) -(defn ^boolean frame-shape? +(defn frame-shape? [{:keys [type]}] (= type :frame)) -(defn ^boolean group-shape? +(defn group-shape? [{:keys [type]}] (= type :group)) -(defn ^boolean text-shape? +(defn text-shape? [{:keys [type]}] (= type :text)) -(defn ^boolean image-shape? +(defn image-shape? [{:keys [type]}] (= type :image)) -(defn ^boolean unframed-shape? +(defn unframed-shape? "Checks if it's a non-frame shape in the top level." [shape] (and (not (frame-shape? shape)) @@ -218,7 +218,7 @@ ([libraries library-id component-id] (get-in libraries [library-id :data :components component-id]))) -(defn ^boolean is-main-of? +(defn is-main-of? [shape-main shape-inst] (and (:shape-ref shape-inst) (or (= (:shape-ref shape-inst) (:id shape-main)) diff --git a/common/src/app/common/text.cljc b/common/src/app/common/text.cljc index b58f6b79a5..df39fe7176 100644 --- a/common/src/app/common/text.cljc +++ b/common/src/app/common/text.cljc @@ -63,16 +63,16 @@ (filter match?) (seq)))) -(defn ^boolean is-text-node? +(defn is-text-node? [node] (and (string? (:text node)) (not= (:text node) ""))) -(defn ^boolean is-paragraph-node? +(defn is-paragraph-node? [node] (= "paragraph" (:type node))) -(defn ^boolean is-root-node? +(defn is-root-node? [node] (= "root" (:type node)))