mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
Fix wrong behavior on canvas position translation.
The translation was not aware of bounding rect size increment when shapes are out of main drawing zone.
This commit is contained in:
parent
e104386398
commit
6226c7f93b
1 changed files with 5 additions and 2 deletions
|
@ -188,9 +188,12 @@
|
|||
(let [viewport (mx/get-ref-dom own "viewport")]
|
||||
(when-let [canvas (dom/get-element-by-class "page-canvas" viewport)]
|
||||
(let [brect (.getBoundingClientRect canvas)
|
||||
bbox (.getBBox canvas)
|
||||
brect (gpt/point (parse-int (.-left brect))
|
||||
(parse-int (.-top brect)))]
|
||||
(gpt/subtract pt brect)))))
|
||||
(parse-int (.-top brect)))
|
||||
bbox (gpt/point (.-x bbox) (.-y bbox))]
|
||||
(-> (gpt/add pt bbox)
|
||||
(gpt/subtract brect))))))
|
||||
|
||||
(on-key-down [event]
|
||||
(when (kbd/space? event)
|
||||
|
|
Loading…
Add table
Reference in a new issue