mirror of
https://github.com/penpot/penpot.git
synced 2025-05-21 14:46:12 +02:00
🐛 Fix text shape edition mode after creation.
This commit is contained in:
parent
36f4948ad1
commit
86b5ed48fd
3 changed files with 16 additions and 14 deletions
|
@ -35,6 +35,7 @@
|
||||||
[uxbox.common.geom.point :as gpt]
|
[uxbox.common.geom.point :as gpt]
|
||||||
[uxbox.common.geom.shapes :as geom]
|
[uxbox.common.geom.shapes :as geom]
|
||||||
[uxbox.common.math :as mth]
|
[uxbox.common.math :as mth]
|
||||||
|
[uxbox.util.timers :as ts]
|
||||||
[uxbox.util.router :as rt]
|
[uxbox.util.router :as rt]
|
||||||
[uxbox.util.transit :as t]
|
[uxbox.util.transit :as t]
|
||||||
[uxbox.util.webapi :as wapi]))
|
[uxbox.util.webapi :as wapi]))
|
||||||
|
@ -464,10 +465,11 @@
|
||||||
uchange {:type :del-obj
|
uchange {:type :del-obj
|
||||||
:id id}]
|
:id id}]
|
||||||
|
|
||||||
|
(rx/concat
|
||||||
(rx/of (dwc/commit-changes [rchange] [uchange] {:commit-local? true})
|
(rx/of (dwc/commit-changes [rchange] [uchange] {:commit-local? true})
|
||||||
(dws/select-shapes (d/ordered-set id))
|
(dws/select-shapes (d/ordered-set id)))
|
||||||
(when (= :text (:type attrs))
|
(->> (rx/of (start-edition-mode id))
|
||||||
(start-edition-mode id)))))))
|
(rx/observe-on :async)))))))
|
||||||
|
|
||||||
(defn- calculate-centered-box
|
(defn- calculate-centered-box
|
||||||
[state aspect-ratio]
|
[state aspect-ratio]
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
(:require
|
(:require
|
||||||
[beicon.core :as rx]
|
[beicon.core :as rx]
|
||||||
[potok.core :as ptk]
|
[potok.core :as ptk]
|
||||||
[uxbox.main.data.workspace :as dw]
|
|
||||||
[uxbox.common.geom.shapes :as geom]
|
|
||||||
[uxbox.common.geom.point :as gpt]
|
[uxbox.common.geom.point :as gpt]
|
||||||
|
[uxbox.common.geom.shapes :as geom]
|
||||||
[uxbox.common.pages :as cp]
|
[uxbox.common.pages :as cp]
|
||||||
[uxbox.common.pages-helpers :as cph]
|
[uxbox.common.pages-helpers :as cph]
|
||||||
[uxbox.util.geom.path :as path]
|
[uxbox.common.uuid :as uuid]
|
||||||
|
[uxbox.main.data.workspace :as dw]
|
||||||
[uxbox.main.snap :as snap]
|
[uxbox.main.snap :as snap]
|
||||||
[uxbox.main.streams :as ms]
|
[uxbox.main.streams :as ms]
|
||||||
[uxbox.common.uuid :as uuid]))
|
[uxbox.util.geom.path :as path]))
|
||||||
|
|
||||||
(declare handle-drawing)
|
(declare handle-drawing)
|
||||||
(declare handle-drawing-generic)
|
(declare handle-drawing-generic)
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
(mf/defc text-wrapper
|
(mf/defc text-wrapper
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[props]
|
[props]
|
||||||
(let [shape (unchecked-get props "shape")
|
(let [{:keys [id x1 y1 content group] :as shape} (unchecked-get props "shape")
|
||||||
{:keys [id x1 y1 content group]} shape
|
|
||||||
selected (mf/deref refs/selected-shapes)
|
selected (mf/deref refs/selected-shapes)
|
||||||
edition (mf/deref refs/selected-edition)
|
edition (mf/deref refs/selected-edition)
|
||||||
edition? (= edition id)
|
edition? (= edition id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue