diff --git a/common/app/common/geom/point.cljc b/common/app/common/geom/point.cljc index 01122e6137..1217260c3d 100644 --- a/common/app/common/geom/point.cljc +++ b/common/app/common/geom/point.cljc @@ -44,16 +44,14 @@ v (number? v) - (Point. v v) + (point v v) (point-like? v) - (Point. (:x v) (:y v)) + (point (:x v) (:y v)) :else (throw (ex-info "Invalid arguments" {:v v})))) ([x y] - ;;(assert (not (nil? x))) - ;;(assert (not (nil? y))) (Point. x y))) (defn angle->point [{:keys [x y]} angle distance] diff --git a/common/app/common/geom/shapes/common.cljc b/common/app/common/geom/shapes/common.cljc index 49abc5943d..07b17ad2b3 100644 --- a/common/app/common/geom/shapes/common.cljc +++ b/common/app/common/geom/shapes/common.cljc @@ -18,8 +18,8 @@ (mth/finite? y) (mth/finite? width) (mth/finite? height)) - (gpt/point (+ x (/ width 2)) - (+ y (/ height 2))))) + (gpt/point (+ x (/ width 2.0)) + (+ y (/ height 2.0))))) (defn center-selrect "Calculate the center of the shape." @@ -36,8 +36,8 @@ miny (reduce min ##Inf pty) maxx (reduce max ##-Inf ptx) maxy (reduce max ##-Inf pty)] - (gpt/point (/ (+ minx maxx) 2) - (/ (+ miny maxy) 2)))) + (gpt/point (/ (+ minx maxx) 2.0) + (/ (+ miny maxy) 2.0)))) (defn center-shape "Calculate the center of the shape." @@ -47,7 +47,7 @@ (defn make-centered-rect "Creates a rect given a center and a width and height" [center width height] - {:x (- (:x center) (/ width 2)) - :y (- (:y center) (/ height 2)) + {:x (- (:x center) (/ width 2.0)) + :y (- (:y center) (/ height 2.0)) :width width :height height}) diff --git a/common/app/common/geom/shapes/transforms.cljc b/common/app/common/geom/shapes/transforms.cljc index 4e0743797b..e688a16ebb 100644 --- a/common/app/common/geom/shapes/transforms.cljc +++ b/common/app/common/geom/shapes/transforms.cljc @@ -62,9 +62,7 @@ (defn transform-points ([points matrix] (transform-points points nil matrix)) - ([points center matrix] - (let [prev (if center (gmt/translate-matrix center) (gmt/matrix)) post (if center (gmt/translate-matrix (gpt/negate center)) (gmt/matrix)) diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index 98e114af71..fde6e0cf27 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -53,6 +53,7 @@ files (some->> recent-ids (map #(get files-map %)) (sort-by :modified-at) + (filter some?) (reverse)) project-id (:id project)