From 83519e85133cb69fceec7d9212ea9a465b3ac11d Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 10 Dec 2020 11:26:11 +0100 Subject: [PATCH] :bug: Fixes scroll and others --- frontend/resources/styles/main/partials/sidebar.scss | 2 +- frontend/src/app/main/ui/shapes/shape.cljs | 5 ++++- frontend/src/app/main/ui/workspace/viewport.cljs | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/resources/styles/main/partials/sidebar.scss b/frontend/resources/styles/main/partials/sidebar.scss index 676219e9a..f474c2364 100644 --- a/frontend/resources/styles/main/partials/sidebar.scss +++ b/frontend/resources/styles/main/partials/sidebar.scss @@ -171,7 +171,7 @@ $width-settings-bar: 16rem; .tool-window-content { display: flex; flex-direction: column; - // overflow-y: auto; + overflow-y: auto; height: 100%; width: 100%; } diff --git a/frontend/src/app/main/ui/shapes/shape.cljs b/frontend/src/app/main/ui/shapes/shape.cljs index cfe637c69..62760374e 100644 --- a/frontend/src/app/main/ui/shapes/shape.cljs +++ b/frontend/src/app/main/ui/shapes/shape.cljs @@ -25,11 +25,14 @@ children (obj/get props "children") render-id (mf/use-memo #(str (uuid/next))) filter-id (str "filter_" render-id) + styles (cond-> (obj/new) + (:blocked shape) (obj/set! "pointerEvents" "none")) group-props (-> (obj/clone props) (obj/without ["shape" "children"]) (obj/set! "id" (str "shape-" (:id shape))) (obj/set! "className" (str "shape " (:type shape))) - (obj/set! "filter" (filters/filter-str filter-id shape)))] + (obj/set! "filter" (filters/filter-str filter-id shape)) + (obj/set! "style" styles))] [:& (mf/provider muc/render-ctx) {:value render-id} [:> :g group-props [:defs diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 0a3b82195..1a97b663e 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -233,7 +233,9 @@ ctrl? (kbd/ctrl? event) shift? (kbd/shift? event) alt? (kbd/alt? event)] - (st/emit! (ms/->MouseEvent :down ctrl? shift? alt?)) + (when (= 1 (.-which event)) + (st/emit! (ms/->MouseEvent :down ctrl? shift? alt?))) + (cond (and (= 1 (.-which event)) (not edition)) (if drawing-tool @@ -259,7 +261,8 @@ ctrl? (kbd/ctrl? event) shift? (kbd/shift? event) alt? (kbd/alt? event)] - (st/emit! (ms/->MouseEvent :up ctrl? shift? alt?)) + (when (= 1 (.-which event)) + (st/emit! (ms/->MouseEvent :up ctrl? shift? alt?))) (when (= 2 (.-which event)) (do