From 8d2992d1a41601596c42f46afcebbef7d3bbf6a8 Mon Sep 17 00:00:00 2001 From: angusiguess Date: Mon, 2 Oct 2017 15:13:09 -0300 Subject: [PATCH] Fix viewport translucency math --- .../wallet/choose_recipient/styles.cljs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/status_im/ui/screens/wallet/choose_recipient/styles.cljs b/src/status_im/ui/screens/wallet/choose_recipient/styles.cljs index dac1b418df..ad3d873a68 100644 --- a/src/status_im/ui/screens/wallet/choose_recipient/styles.cljs +++ b/src/status_im/ui/screens/wallet/choose_recipient/styles.cljs @@ -103,22 +103,22 @@ (defn viewfinder-translucent [height width side] (let [viewport-offset 0.1666 - height-offset (* viewport-offset height) - width-offset (* viewport-offset width)] + min-dimension (min height width) + min-offset (* viewport-offset min-dimension)] (cond-> {:position :absolute :background-color :black :opacity 0.7} - (= :top side) (assoc :height height-offset - :width width) - (= :right side) (assoc :height (- height height-offset) - :width width-offset - :bottom 0 - :right 0) - (= :bottom side) (assoc :height height-offset - :width (- width width-offset) - :bottom 0 - :left 0) - (= :left side) (assoc :height (- height (* 2 height-offset)) - :width width-offset - :top height-offset - :left 0)))) \ No newline at end of file + (= :top side) (assoc :height min-offset + :width width) + (= :right side) (assoc :height (- height min-offset) + :width min-offset + :bottom 0 + :right 0) + (= :bottom side) (assoc :height min-offset + :width (- width min-offset) + :bottom 0 + :left 0) + (= :left side) (assoc :height (- height (* 2 min-offset)) + :width min-offset + :top min-offset + :left 0))))