0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 04:49:03 -05:00

🐛 Fix hide artboard

This commit is contained in:
alonso.torres 2022-05-24 22:45:15 +02:00
parent 6901431f8a
commit 8a6f01404c
3 changed files with 33 additions and 30 deletions

View file

@ -128,7 +128,8 @@
[:& (mf/provider ctx/render-ctx) {:value render-id} [:& (mf/provider ctx/render-ctx) {:value render-id}
[:g.frame-container {:id (dm/str "frame-container-" (:id shape)) [:g.frame-container {:id (dm/str "frame-container-" (:id shape))
:key "frame-container" :key "frame-container"
:ref on-frame-load} :ref on-frame-load
:opacity (when (:hidden shape) 0)}
[:& ff/fontfaces-style {:fonts fonts}] [:& ff/fontfaces-style {:fonts fonts}]
[:g.frame-thumbnail-wrapper {:id (dm/str "thumbnail-container-" (:id shape))} [:g.frame-thumbnail-wrapper {:id (dm/str "thumbnail-container-" (:id shape))}
[:> frame/frame-thumbnail {:key (dm/str (:id shape)) [:> frame/frame-thumbnail {:key (dm/str (:id shape))

View file

@ -135,35 +135,36 @@
(on-frame-leave (:id frame)))) (on-frame-leave (:id frame))))
text-pos-x (if (:use-for-thumbnail? frame) 15 0)] text-pos-x (if (:use-for-thumbnail? frame) 15 0)]
[:* (when (not (:hidden frame))
(when (:use-for-thumbnail? frame) [:*
[:g {:transform (str (when (and selected? modifiers) (when (:use-for-thumbnail? frame)
(str (:displacement modifiers) " ")) [:g {:transform (str (when (and selected? modifiers)
(text-transform label-pos zoom))} (str (:displacement modifiers) " "))
[:svg {:x 0 (text-transform label-pos zoom))}
:y -9 [:svg {:x 0
:width 12 :y -9
:height 12 :width 12
:class "workspace-frame-icon" :height 12
:class "workspace-frame-icon"
:style {:fill (when selected? "var(--color-primary-dark)")}
:visibility (if show-artboard-names? "visible" "hidden")}
[:use {:href "#icon-set-thumbnail"}]]])
[:text {:x text-pos-x
:y 0
:width width
:height 20
:class "workspace-frame-label"
:transform (str (when (and selected? modifiers)
(str (:displacement modifiers) " "))
(text-transform label-pos zoom))
:style {:fill (when selected? "var(--color-primary-dark)")} :style {:fill (when selected? "var(--color-primary-dark)")}
:visibility (if show-artboard-names? "visible" "hidden")} :visibility (if show-artboard-names? "visible" "hidden")
[:use {:href "#icon-set-thumbnail"}]]]) :on-mouse-down on-mouse-down
[:text {:x text-pos-x :on-double-click on-double-click
:y 0 :on-context-menu on-context-menu
:width width :on-pointer-enter on-pointer-enter
:height 20 :on-pointer-leave on-pointer-leave}
:class "workspace-frame-label" (:name frame)]])))
:transform (str (when (and selected? modifiers)
(str (:displacement modifiers) " "))
(text-transform label-pos zoom))
:style {:fill (when selected? "var(--color-primary-dark)")}
:visibility (if show-artboard-names? "visible" "hidden")
:on-mouse-down on-mouse-down
:on-double-click on-double-click
:on-context-menu on-context-menu
:on-pointer-enter on-pointer-enter
:on-pointer-leave on-pointer-leave}
(:name frame)]]))
(mf/defc frame-titles (mf/defc frame-titles
{::mf/wrap-props false {::mf/wrap-props false

View file

@ -125,7 +125,8 @@
match-criteria? match-criteria?
(fn [shape] (fn [shape]
(and (not (:hidden shape)) (and (not (:hidden shape))
(not (:blocked shape)) (or (= :frame (:type shape)) ;; We return frames even if blocked
(not (:blocked shape)))
(or (not frame-id) (= frame-id (:frame-id shape))) (or (not frame-id) (= frame-id (:frame-id shape)))
(case (:type shape) (case (:type shape)
:frame include-frames? :frame include-frames?