mirror of
https://github.com/penpot/penpot.git
synced 2025-02-09 00:28:20 -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
|
(defn translate-point-from-viewport
|
||||||
"Translate a point in the viewport into client coordinates"
|
"Translate a point in the viewport into client coordinates"
|
||||||
[pt viewport zoom]
|
[pt viewport zoom]
|
||||||
(let [vbox (.. ^js viewport -viewBox -baseVal)
|
(when (some? viewport)
|
||||||
box (gpt/point (.-x vbox) (.-y vbox))
|
(let [vbox (.. ^js viewport -viewBox -baseVal)
|
||||||
zoom (gpt/point zoom)]
|
box (gpt/point (.-x vbox) (.-y vbox))
|
||||||
(-> (gpt/subtract pt box)
|
zoom (gpt/point zoom)]
|
||||||
(gpt/multiply zoom))))
|
(-> (gpt/subtract pt box)
|
||||||
|
(gpt/multiply zoom)))))
|
||||||
|
|
||||||
(mf/defc text-editor-viewport
|
(mf/defc text-editor-viewport
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
|
|
Loading…
Add table
Reference in a new issue