mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 02:21:38 +02:00
✨ Use bounding box when showing interactions
This commit is contained in:
parent
0aeb966b11
commit
54b7d04639
6 changed files with 6 additions and 31 deletions
|
@ -40,11 +40,8 @@
|
|||
{::mf/wrap-props false}
|
||||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
{:keys [id x y width height]} shape
|
||||
transform (geom/transform-matrix shape)
|
||||
|
||||
{:keys [x y width height]} (geom/selection-rect-shape shape)
|
||||
show-interactions? (mf/deref refs/show-interactions?)
|
||||
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-mouse-down-viewer % shape))]
|
||||
|
@ -58,7 +55,6 @@
|
|||
:y (- y 1)
|
||||
:width (+ width 2)
|
||||
:height (+ height 2)
|
||||
:transform transform
|
||||
:fill "#31EFB8"
|
||||
:stroke "#31EFB8"
|
||||
:strokeWidth 1
|
||||
|
|
|
@ -37,12 +37,8 @@
|
|||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
frame (unchecked-get props "frame")
|
||||
|
||||
{:keys [x y width height]} shape
|
||||
transform (geom/transform-matrix shape)
|
||||
|
||||
{:keys [x y width height]} (geom/selection-rect-shape shape)
|
||||
show-interactions? (mf/deref refs/show-interactions?)
|
||||
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-mouse-down-viewer % shape))]
|
||||
|
@ -55,7 +51,6 @@
|
|||
:y (- y 1)
|
||||
:width (+ width 2)
|
||||
:height (+ height 2)
|
||||
:transform transform
|
||||
:fill "#31EFB8"
|
||||
:stroke "#31EFB8"
|
||||
:strokeWidth 1
|
||||
|
|
|
@ -46,11 +46,8 @@
|
|||
{::mf/wrap-props false}
|
||||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
{:keys [x y width height]} shape
|
||||
transform (geom/transform-matrix shape)
|
||||
|
||||
{:keys [x y width height]} (geom/selection-rect-shape shape)
|
||||
show-interactions? (mf/deref refs/show-interactions?)
|
||||
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-mouse-down-viewer % shape))]
|
||||
|
@ -63,7 +60,6 @@
|
|||
:y (- y 1)
|
||||
:width (+ width 2)
|
||||
:height (+ height 2)
|
||||
:transform transform
|
||||
:fill "#31EFB8"
|
||||
:stroke "#31EFB8"
|
||||
:strokeWidth 1
|
||||
|
|
|
@ -52,11 +52,8 @@
|
|||
{::mf/wrap-props false}
|
||||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
{:keys [x y width height]} (geom/shape->rect-shape shape)
|
||||
transform (geom/transform-matrix shape)
|
||||
|
||||
{:keys [x y width height]} (geom/selection-rect-shape shape)
|
||||
show-interactions? (mf/deref refs/show-interactions?)
|
||||
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-mouse-down-viewer % shape))]
|
||||
|
@ -69,7 +66,6 @@
|
|||
:y (- y 1)
|
||||
:width (+ width 2)
|
||||
:height (+ height 2)
|
||||
:transform transform
|
||||
:fill "#31EFB8"
|
||||
:stroke "#31EFB8"
|
||||
:strokeWidth 1
|
||||
|
|
|
@ -41,11 +41,8 @@
|
|||
{::mf/wrap-props false}
|
||||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
{:keys [x y width height]} shape
|
||||
transform (geom/transform-matrix shape)
|
||||
|
||||
{:keys [x y width height]} (geom/selection-rect-shape shape)
|
||||
show-interactions? (mf/deref refs/show-interactions?)
|
||||
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-mouse-down-viewer % shape))]
|
||||
|
@ -59,7 +56,6 @@
|
|||
:y (- y 1)
|
||||
:width (+ width 2)
|
||||
:height (+ height 2)
|
||||
:transform transform
|
||||
:fill "#31EFB8"
|
||||
:stroke "#31EFB8"
|
||||
:strokeWidth 1
|
||||
|
|
|
@ -80,11 +80,8 @@
|
|||
{::mf/wrap-props false}
|
||||
[props]
|
||||
(let [shape (unchecked-get props "shape")
|
||||
{:keys [x y width height]} shape
|
||||
transform (geom/transform-matrix shape)
|
||||
|
||||
{:keys [x y width height]} (geom/selection-rect-shape shape)
|
||||
show-interactions? (mf/deref refs/show-interactions?)
|
||||
|
||||
on-mouse-down (mf/use-callback
|
||||
(mf/deps shape)
|
||||
#(common/on-mouse-down-viewer % shape))]
|
||||
|
@ -97,7 +94,6 @@
|
|||
:y (- y 1)
|
||||
:width (+ width 2)
|
||||
:height (+ height 2)
|
||||
:transform transform
|
||||
:fill "#31EFB8"
|
||||
:stroke "#31EFB8"
|
||||
:strokeWidth 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue