mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🐛 Remove a bigger rect on resize handlers.
This commit is contained in:
parent
54be06ff18
commit
b29aac5d5f
1 changed files with 3 additions and 12 deletions
|
@ -32,7 +32,7 @@
|
||||||
(def rotation-handler-size 25)
|
(def rotation-handler-size 25)
|
||||||
(def resize-point-radius 4)
|
(def resize-point-radius 4)
|
||||||
(def resize-point-circle-radius 10)
|
(def resize-point-circle-radius 10)
|
||||||
(def resize-point-rect-size 20)
|
(def resize-point-rect-size 8)
|
||||||
(def resize-side-height 8)
|
(def resize-side-height 8)
|
||||||
(def selection-rect-color "#1FDEA7")
|
(def selection-rect-color "#1FDEA7")
|
||||||
(def selection-rect-width 1)
|
(def selection-rect-width 1)
|
||||||
|
@ -124,7 +124,8 @@
|
||||||
:transform transform
|
:transform transform
|
||||||
:on-mouse-down on-rotate}]))
|
:on-mouse-down on-rotate}]))
|
||||||
|
|
||||||
(mf/defc resize-point-handler [{:keys [cx cy zoom position on-resize transform rotation]}]
|
(mf/defc resize-point-handler
|
||||||
|
[{:keys [cx cy zoom position on-resize transform rotation]}]
|
||||||
(let [{cx' :x cy' :y} (gpt/transform (gpt/point cx cy) transform)
|
(let [{cx' :x cy' :y} (gpt/transform (gpt/point cx cy) transform)
|
||||||
rot-square (case position
|
rot-square (case position
|
||||||
:top-left 0
|
:top-left 0
|
||||||
|
@ -142,16 +143,6 @@
|
||||||
:cx cx'
|
:cx cx'
|
||||||
:cy cy'}]
|
:cy cy'}]
|
||||||
|
|
||||||
[:rect {:x cx
|
|
||||||
:y cy
|
|
||||||
:width (/ resize-point-rect-size zoom)
|
|
||||||
:height (/ resize-point-rect-size zoom)
|
|
||||||
:fill (if (debug? :resize-handler) "red" "transparent")
|
|
||||||
:on-mouse-down #(on-resize {:x cx' :y cy'} %)
|
|
||||||
:style {:cursor (if (#{:top-left :bottom-right} position)
|
|
||||||
(cur/resize-nesw rotation) (cur/resize-nwse rotation))}
|
|
||||||
:transform (gmt/multiply transform
|
|
||||||
(gmt/rotate-matrix rot-square (gpt/point cx cy)))}]
|
|
||||||
[:circle {:on-mouse-down #(on-resize {:x cx' :y cy'} %)
|
[:circle {:on-mouse-down #(on-resize {:x cx' :y cy'} %)
|
||||||
:r (/ resize-point-circle-radius zoom)
|
:r (/ resize-point-circle-radius zoom)
|
||||||
:fill (if (debug? :resize-handler) "red" "transparent")
|
:fill (if (debug? :resize-handler) "red" "transparent")
|
||||||
|
|
Loading…
Add table
Reference in a new issue