From ff701ecf136b47c311defb1c9b10a28226ce5826 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 27 May 2020 12:27:14 +0200 Subject: [PATCH] :bug: Fix unexpected error on calculating thumnail size. --- common/uxbox/common/geom/shapes.cljc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/uxbox/common/geom/shapes.cljc b/common/uxbox/common/geom/shapes.cljc index 1cf3e2bcf6..a29f460822 100644 --- a/common/uxbox/common/geom/shapes.cljc +++ b/common/uxbox/common/geom/shapes.cljc @@ -651,11 +651,16 @@ (defn fix-invalid-rect-values [rect-shape] - (letfn [(check [num] (if (or (nil? num) (mth/nan? num)) 0 num)) + (letfn [(check [num] + (if (or (nil? num) (mth/nan? num) (= ##Inf num) (= ##-Inf num)) 0 num)) (to-positive [num] (if (< num 1) 1 num))] (-> rect-shape (update :x check) (update :y check) + (update :x1 check) + (update :y1 check) + (update :x2 check) + (update :y2 check) (update :width (comp to-positive check)) (update :height (comp to-positive check)))))