diff --git a/common/src/app/common/attrs.cljc b/common/src/app/common/attrs.cljc index ce6af91313..febb784461 100644 --- a/common/src/app/common/attrs.cljc +++ b/common/src/app/common/attrs.cljc @@ -9,7 +9,7 @@ ;; Extract some attributes of a list of shapes. ;; For each attribute, if the value is the same in all shapes, -;; wll take this value. If there is any shape that is different, +;; will take this value. If there is any shape that is different, ;; the value of the attribute will be the keyword :multiple. ;; ;; If some shape has the value nil in any attribute, it's diff --git a/common/src/app/common/data.cljc b/common/src/app/common/data.cljc index 77dcae0101..b465216dce 100644 --- a/common/src/app/common/data.cljc +++ b/common/src/app/common/data.cljc @@ -178,7 +178,7 @@ "Maps a function to each pair of values that can be combined inside the function without repetition. - Optional parmeters: + Optional parameters: `pred?` A predicate that if not satisfied won't process the pair `target?` A collection that will be used as seed to be stored @@ -433,8 +433,8 @@ (str maybe-keyword))))) (defn with-next - "Given a collectin will return a new collection where each element - is paried with the next item in the collection + "Given a collection will return a new collection where each element + is paired with the next item in the collection (with-next (range 5)) => [[0 1] [1 2] [2 3] [3 4] [4 nil]" [coll] (map vector @@ -442,8 +442,8 @@ (concat [] (rest coll) [nil]))) (defn with-prev - "Given a collectin will return a new collection where each element - is paried with the previous item in the collection + "Given a collection will return a new collection where each element + is paired with the previous item in the collection (with-prev (range 5)) => [[0 nil] [1 0] [2 1] [3 2] [4 3]" [coll] (map vector @@ -469,7 +469,7 @@ (keyword (str prefix kw)))) (defn tap - "Simpilar to the tap in rxjs but for plain collections" + "Similar to the tap in rxjs but for plain collections" [f coll] (f coll) coll) diff --git a/common/src/app/common/exceptions.cljc b/common/src/app/common/exceptions.cljc index 3371dbbd94..0bfbc8988b 100644 --- a/common/src/app/common/exceptions.cljc +++ b/common/src/app/common/exceptions.cljc @@ -12,7 +12,7 @@ (s/def ::type keyword?) (s/def ::code keyword?) -(s/def ::mesage string?) +(s/def ::message string?) (s/def ::hint string?) (s/def ::cause #?(:clj #(instance? Throwable %) :cljs #(instance? js/Error %))) @@ -20,7 +20,7 @@ (s/keys :req-un [::type] :opt-un [::code ::hint - ::mesage + ::message ::cause])) (defn error diff --git a/common/src/app/common/geom/align.cljc b/common/src/app/common/geom/align.cljc index 45d8b43210..0c34d2b9b5 100644 --- a/common/src/app/common/geom/align.cljc +++ b/common/src/app/common/geom/align.cljc @@ -78,7 +78,7 @@ "Distribute equally the space between shapes in the given axis. If there is no space enough, it does nothing. It takes into account the form of the shape and the rotation, what is distributed is - the wrapping recangles of the shapes. If any shape is a group, + the wrapping rectangles of the shapes. If any shape is a group, move also all of its recursive children." [shapes axis objects] (let [coord (if (= axis :horizontal) :x :y) @@ -116,7 +116,7 @@ (mapcat #(recursive-move %1 {coord %2 other-coord 0} objects) sorted-shapes deltas))))) -;; Adjusto to viewport +;; Adjust to viewport (defn adjust-to-viewport ([viewport srect] (adjust-to-viewport viewport srect nil)) diff --git a/common/src/app/common/geom/point.cljc b/common/src/app/common/geom/point.cljc index b73a050e61..21fecc68b3 100644 --- a/common/src/app/common/geom/point.cljc +++ b/common/src/app/common/geom/point.cljc @@ -187,14 +187,14 @@ (defn round "Change the precision of the point coordinates." ([point] (round point 0)) - ([{:keys [x y] :as p} decimanls] + ([{:keys [x y] :as p} decimals] (assert (point? p)) - (assert (number? decimanls)) - (Point. (mth/precision x decimanls) - (mth/precision y decimanls)))) + (assert (number? decimals)) + (Point. (mth/precision x decimals) + (mth/precision y decimals)))) (defn transform - "Transform a point applying a matrix transfomation." + "Transform a point applying a matrix transformation." [{:keys [x y] :as p} {:keys [a b c d e f]}] (assert (point? p)) (Point. (+ (* x a) (* y c) e) diff --git a/common/src/app/common/geom/shapes/intersect.cljc b/common/src/app/common/geom/shapes/intersect.cljc index 14360639ff..bffd724861 100644 --- a/common/src/app/common/geom/shapes/intersect.cljc +++ b/common/src/app/common/geom/shapes/intersect.cljc @@ -147,7 +147,7 @@ (not= wn 0)))) ;; A intersects with B -;; Three posible cases: +;; Three possible cases: ;; 1) A is inside of B ;; 2) B is inside of A ;; 3) A intersects B @@ -207,11 +207,11 @@ (<= v 1))) (defn intersects-line-ellipse? - "Checks wether a single line intersects with the given ellipse" + "Checks whether a single line intersects with the given ellipse" [[{x1 :x y1 :y} {x2 :x y2 :y}] {:keys [cx cy rx ry]}] ;; Given the ellipse inequality after inserting the line parametric equations - ;; we resolve t and gives us a cuadratic formula + ;; we resolve t and gives us a quadratic formula ;; The result of this quadratic will give us a value of T that needs to be ;; between 0-1 to be in the segment @@ -284,7 +284,7 @@ (intersects-lines-ellipse? rect-lines ellipse-data)))) (defn overlaps? - "General case to check for overlaping between shapes and a rectangle" + "General case to check for overlapping between shapes and a rectangle" [shape rect] (let [stroke-width (/ (or (:stroke-width shape) 0) 2) rect (-> rect diff --git a/common/src/app/common/geom/shapes/path.cljc b/common/src/app/common/geom/shapes/path.cljc index d8bd67cfc8..f1dd986a16 100644 --- a/common/src/app/common/geom/shapes/path.cljc +++ b/common/src/app/common/geom/shapes/path.cljc @@ -22,7 +22,7 @@ (mth/almost-zero? (- a b))) (defn calculate-opposite-handler - "Given a point and its handler, gives the symetric handler" + "Given a point and its handler, gives the symmetric handler" [point handler] (let [handler-vector (gpt/to-vec point handler)] (gpt/add point (gpt/negate handler-vector)))) @@ -179,7 +179,7 @@ (and (mth/almost-zero? d) (mth/almost-zero? a)) [(/ (- c) b)] - ;; Cuadratic + ;; Quadratic (mth/almost-zero? d) [(/ (+ (- b) sqrt-b2-4ac) (* 2 a)) @@ -681,7 +681,7 @@ (defn ray-line-intersect [point [a b :as line]] - ;; If the ray is paralell to the line there will be no crossings + ;; If the ray is parallel to the line there will be no crossings (let [ray-line [point (gpt/point (inc (:x point)) (:y point))] ;; Rays fail when fall just in a vertex so we move a bit upward ;; because only want to use this for insideness diff --git a/common/src/app/common/geom/shapes/transforms.cljc b/common/src/app/common/geom/shapes/transforms.cljc index bfb6a751f8..220fa3014a 100644 --- a/common/src/app/common/geom/shapes/transforms.cljc +++ b/common/src/app/common/geom/shapes/transforms.cljc @@ -34,7 +34,7 @@ (mapv #(gpt/add % move-vec)))) (defn move - "Move the shape relativelly to its current + "Move the shape relatively to its current position applying the provided delta." [shape {dx :x dy :y}] (let [dx (d/check-num dx) @@ -71,7 +71,7 @@ :else scale)) (defn- calculate-skew-angle - "Calculates the skew angle of the paralelogram given by the points" + "Calculates the skew angle of the parallelogram given by the points" [[p1 _ p3 p4]] (let [v1 (gpt/to-vec p3 p4) v2 (gpt/to-vec p4 p1)] @@ -83,13 +83,13 @@ (- 90 (gpt/angle-with-other v1 v2))))) (defn- calculate-height - "Calculates the height of a paralelogram given by the points" + "Calculates the height of a parallelogram given by the points" [[p1 _ _ p4]] (-> (gpt/to-vec p4 p1) (gpt/length))) (defn- calculate-width - "Calculates the width of a paralelogram given by the points" + "Calculates the width of a parallelogram given by the points" [[p1 p2 _ _]] (-> (gpt/to-vec p1 p2) (gpt/length))) @@ -299,7 +299,7 @@ (gpr/rect->points) (gco/transform-points shape-center (:transform group (gmt/matrix)))) - ;; Calculte the new selrect + ;; Calculate the new selrect new-selrect (gpr/points->selrect base-points)] ;; Updates the shape and the applytransform-rect will update the other properties diff --git a/common/src/app/common/pages/changes.cljc b/common/src/app/common/pages/changes.cljc index a2211b238c..afaf3ce79d 100644 --- a/common/src/app/common/pages/changes.cljc +++ b/common/src/app/common/pages/changes.cljc @@ -291,7 +291,7 @@ (reduce update-parent-id $ shapes) ;; Analyze the old parents and clear the old links - ;; only if the new parrent is different form old + ;; only if the new parent is different form old ;; parent. (reduce (partial remove-from-old-parent cpindex) $ shapes) diff --git a/common/src/app/common/path/bool.cljc b/common/src/app/common/path/bool.cljc index 8269c1e287..016dead9c8 100644 --- a/common/src/app/common/path/bool.cljc +++ b/common/src/app/common/path/bool.cljc @@ -256,7 +256,7 @@ (defn fix-move-to [content] - ;; Remove the field `:prev` and makes the necesaries `move-to` + ;; Remove the field `:prev` and makes the necessaries `move-to` ;; then clean the subpaths (loop [current (first content) diff --git a/common/src/app/common/path/commands.cljc b/common/src/app/common/path/commands.cljc index 80737db8cf..d787c2457a 100644 --- a/common/src/app/common/path/commands.cljc +++ b/common/src/app/common/path/commands.cljc @@ -147,7 +147,7 @@ []))))) (defn opposite-index - "Calculate sthe opposite index given a prefix and an index" + "Calculates the opposite index given a prefix and an index" [content index prefix] (let [point (if (= prefix :c2) diff --git a/common/src/app/common/path/subpaths.cljc b/common/src/app/common/path/subpaths.cljc index 202e273b1d..8b61015441 100644 --- a/common/src/app/common/path/subpaths.cljc +++ b/common/src/app/common/path/subpaths.cljc @@ -126,7 +126,7 @@ (pt= (:from subpath) (:to subpath))) (defn close-subpaths - "Searches a path for posible supaths that can create closed loops and merge them" + "Searches a path for possible supaths that can create closed loops and merge them" [content] (let [subpaths (get-subpaths content) closed-subpaths diff --git a/common/src/app/common/spec.cljc b/common/src/app/common/spec.cljc index e7614707ba..0a6f4a4c61 100644 --- a/common/src/app/common/spec.cljc +++ b/common/src/app/common/spec.cljc @@ -14,7 +14,7 @@ ;; NOTE: don't remove this, causes exception on advanced build ;; because of some strange interaction with cljs.spec.alpha and - ;; modules spliting. + ;; modules splitting. [app.common.exceptions :as ex] [app.common.geom.point :as gpt] [app.common.uuid :as uuid] diff --git a/common/test/app/common/geom_shapes_test.cljc b/common/test/app/common/geom_shapes_test.cljc index 2b6a6fc57c..49d3036117 100644 --- a/common/test/app/common/geom_shapes_test.cljc +++ b/common/test/app/common/geom_shapes_test.cljc @@ -175,7 +175,7 @@ :x :y :width :height :x1 :y1 :x2 :y2)) :rect :path)) - (t/testing "Transform shape with invalid selrect fails gracefuly" + (t/testing "Transform shape with invalid selrect fails gracefully" (t/are [type selrect] (let [modifiers {:displacement (gmt/matrix)} shape-before (-> (create-test-shape type {:modifiers modifiers}) diff --git a/common/test/app/common/pages_migrations_test.cljc b/common/test/app/common/pages_migrations_test.cljc index ab697886eb..12950ca0a7 100644 --- a/common/test/app/common/pages_migrations_test.cljc +++ b/common/test/app/common/pages_migrations_test.cljc @@ -71,7 +71,7 @@ :components {} :version 7} - expct (-> data + expect (-> data (update-in [:pages-index page-id :objects] dissoc (uuid/custom 1 2) (uuid/custom 1 3) @@ -84,8 +84,8 @@ res (cpm/migrate-data data)] ;; (pprint res) - ;; (pprint expct) + ;; (pprint expect) - (t/is (= (dissoc expct :version) + (t/is (= (dissoc expect :version) (dissoc res :version))) ))