From 48d2135cf30497cab67b7f73f7e5c69164288c7b Mon Sep 17 00:00:00 2001 From: Aitor Moreno Date: Wed, 18 Feb 2026 15:52:23 +0100 Subject: [PATCH] :bug: Fix 45 rotated board doesn't show title properly --- .../workspace/sidebar/options/menus/measures.cljs | 15 ++++++++++++++- .../src/app/main/ui/workspace/viewport/utils.cljs | 4 ++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.cljs index 769f7910f1..9c5030e99c 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.cljs @@ -92,6 +92,19 @@ (def ^:private xf:map-type (map :type)) (def ^:private xf:mapcat-type-to-options (mapcat type->options)) +(defn fixed-decimal-value + "Fixes the amount of decimals that are kept" + ([value] + (fixed-decimal-value value 2)) + + ([value decimals] + (cond + (string? value) + (fixed-decimal-value (parse-double value) decimals) + + (number? value) + (parse-double (.toFixed value decimals))))) + (mf/defc measures-menu* [{:keys [ids values applied-tokens type shapes]}] (let [token-numeric-inputs @@ -300,7 +313,7 @@ (mf/deps ids) (fn [value] (if (or (string? value) (number? value)) - (do + (let [value (fixed-decimal-value value)] (st/emit! (udw/trigger-bounding-box-cloaking ids)) (st/emit! (udw/increase-rotation ids value))) (st/emit! (udw/trigger-bounding-box-cloaking ids) diff --git a/frontend/src/app/main/ui/workspace/viewport/utils.cljs b/frontend/src/app/main/ui/workspace/viewport/utils.cljs index a4ac92b6c2..b5d99f42f2 100644 --- a/frontend/src/app/main/ui/workspace/viewport/utils.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/utils.cljs @@ -55,7 +55,7 @@ (defn top? [cur cand] - (let [closey? (mth/close? (:y cand) (:y cur))] + (let [closey? (mth/close? (:y cand) (:y cur) 0.01)] (cond (and closey? (< (:x cand) (:x cur))) cand closey? cur @@ -64,7 +64,7 @@ (defn right? [cur cand] - (let [closex? (mth/close? (:x cand) (:x cur))] + (let [closex? (mth/close? (:x cand) (:x cur) 0.01)] (cond (and closex? (< (:y cand) (:y cur))) cand closex? cur