mirror of
https://github.com/penpot/penpot.git
synced 2025-02-03 04:49:03 -05:00
🐛 Fix problem when changing page while editing text
This commit is contained in:
parent
444567faac
commit
928128ba2d
1 changed files with 6 additions and 5 deletions
|
@ -235,11 +235,12 @@
|
|||
(defn translate-point-from-viewport
|
||||
"Translate a point in the viewport into client coordinates"
|
||||
[pt viewport zoom]
|
||||
(let [vbox (.. ^js viewport -viewBox -baseVal)
|
||||
box (gpt/point (.-x vbox) (.-y vbox))
|
||||
zoom (gpt/point zoom)]
|
||||
(-> (gpt/subtract pt box)
|
||||
(gpt/multiply zoom))))
|
||||
(when (some? viewport)
|
||||
(let [vbox (.. ^js viewport -viewBox -baseVal)
|
||||
box (gpt/point (.-x vbox) (.-y vbox))
|
||||
zoom (gpt/point zoom)]
|
||||
(-> (gpt/subtract pt box)
|
||||
(gpt/multiply zoom)))))
|
||||
|
||||
(mf/defc text-editor-viewport
|
||||
{::mf/wrap-props false}
|
||||
|
|
Loading…
Add table
Reference in a new issue