diff --git a/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs b/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs index 89dc31376..2aaceb8c8 100644 --- a/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs +++ b/frontend/src/app/main/ui/workspace/shapes/frame/thumbnail_render.cljs @@ -17,7 +17,7 @@ [beicon.core :as rx] [rumext.alpha :as mf])) -(def thumbnail-scale-factor 2) +;; (def thumbnail-scale-factor 2) (defn- draw-thumbnail-canvas [canvas-node img-node] @@ -27,11 +27,12 @@ canvas-width (.-width canvas-node) canvas-height (.-height canvas-node)] - (set! (.-width canvas-node) (* thumbnail-scale-factor canvas-width)) - (set! (.-height canvas-node) (* thumbnail-scale-factor canvas-height)) - (.setTransform canvas-context thumbnail-scale-factor 0 0 thumbnail-scale-factor 0 0) - (set! (.-imageSmoothingEnabled canvas-context) true) - (set! (.-imageSmoothingQuality canvas-context) "high") + ;; TODO: Expermient with different scale factors + ;; (set! (.-width canvas-node) (* thumbnail-scale-factor canvas-width)) + ;; (set! (.-height canvas-node) (* thumbnail-scale-factor canvas-height)) + ;; (.setTransform canvas-context thumbnail-scale-factor 0 0 thumbnail-scale-factor 0 0) + ;; (set! (.-imageSmoothingEnabled canvas-context) true) + ;; (set! (.-imageSmoothingQuality canvas-context) "high") (.clearRect canvas-context 0 0 canvas-width canvas-height) (.drawImage canvas-context img-node 0 0 canvas-width canvas-height) diff --git a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs index 9fad99089..856794da4 100644 --- a/frontend/src/app/main/ui/workspace/viewport/hooks.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/hooks.cljs @@ -242,19 +242,19 @@ ;; Rules for active frame: ;; - If zoom < 25% displays thumbnail except when selecting a single frame or a child ;; - We always active the current hovering frame for zoom > 25% - ;; - When zoom > 150% we activate the frames that are inside the vbox + ;; - When zoom > 130% we activate the frames that are inside the vbox ;; - If no hovering over any frames we keep the previous active one ;; - Check always that the active frames are inside the vbox (let [is-active-frame? (fn [id] (or - ;; Zoom > 150% shows every frame - (> zoom 1.5) + ;; Zoom > 130% shows every frame + (> zoom 1.3) - ;; Zoom >= 30% will show frames hovering + ;; Zoom >= 25% will show frames hovering (and - (>= zoom 0.3) + (>= zoom 0.25) (or (= id hover-frame) (= id @last-hover-frame))) ;; Otherwise, if it's a selected frame @@ -272,7 +272,7 @@ all-frames)] (when (not= @active-frames new-active-frames) - (reset! active-frames new-active-frames))))))) + (reset! active-frames #{} #_new-active-frames))))))) ;; NOTE: this is executed on each page change, maybe we need to move ;; this shortcuts outside the viewport?