diff --git a/frontend/resources/styles/main/partials/workspace.scss b/frontend/resources/styles/main/partials/workspace.scss index 848a64a64..397ce7cf0 100644 --- a/frontend/resources/styles/main/partials/workspace.scss +++ b/frontend/resources/styles/main/partials/workspace.scss @@ -49,7 +49,8 @@ position: fixed; right: 240px; text-align: center; - width: 80px; + width: 100px; + padding-bottom: 2px; span { color: $color-white; diff --git a/frontend/src/uxbox/main/data/workspace.cljs b/frontend/src/uxbox/main/data/workspace.cljs index 2f435d8c4..9a588fc5c 100644 --- a/frontend/src/uxbox/main/data/workspace.cljs +++ b/frontend/src/uxbox/main/data/workspace.cljs @@ -24,8 +24,7 @@ [uxbox.main.refs :as refs] [uxbox.main.store :as st] [uxbox.main.workers :as uwrk] - [uxbox.util.data :refer [dissoc-in]] - [uxbox.util.data :refer [index-of]] + [uxbox.util.data :refer [dissoc-in index-of]] [uxbox.util.forms :as sc] [uxbox.util.geom.matrix :as gmt] [uxbox.util.geom.point :as gpt] diff --git a/frontend/src/uxbox/main/ui/workspace/viewport.cljs b/frontend/src/uxbox/main/ui/workspace/viewport.cljs index a78db90f4..299b5c4ac 100644 --- a/frontend/src/uxbox/main/ui/workspace/viewport.cljs +++ b/frontend/src/uxbox/main/ui/workspace/viewport.cljs @@ -28,24 +28,23 @@ [uxbox.main.ui.workspace.selection :refer [selection-handlers]] [uxbox.util.data :refer [parse-int]] + [uxbox.util.components :refer [use-rxsub]] [uxbox.util.dom :as dom] [uxbox.util.geom.point :as gpt]) (:import goog.events.EventType)) ;; --- Coordinates Widget -(mf/def coordinates - :mixins [mf/reactive mf/memo] - :render - (fn [own {:keys [zoom] :as props}] - (let [coords (some-> (mf/react refs/canvas-mouse-position) - (gpt/divide zoom) - (gpt/round 0))] - [:ul.coordinates - [:span {:alt "x"} - (str "X: " (:x coords "-"))] - [:span {:alt "y"} - (str "Y: " (:y coords "-"))]]))) +(mf/defc coordinates + [{:keys [zoom] :as props}] + (let [coords (some-> (use-rxsub uws/viewport-mouse-position) + (gpt/divide zoom) + (gpt/round 0))] + [:ul.coordinates + [:span {:alt "x"} + (str "X: " (:x coords "-"))] + [:span {:alt "y"} + (str "Y: " (:y coords "-"))]])) ;; --- Cursor tooltip