mirror of
https://github.com/penpot/penpot.git
synced 2026-08-26 22:58:43 +00:00
🐛 Fix outline with single click text creation
This commit is contained in:
parent
b179aa79b1
commit
0caaefefea
@ -12,18 +12,20 @@
|
|||||||
[app.main.features :as features]
|
[app.main.features :as features]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
|
[app.render-wasm.api :as wasm.api]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(mf/defc text-edition-outline
|
(mf/defc text-edition-outline
|
||||||
[{:keys [shape zoom modifiers]}]
|
[{:keys [shape zoom modifiers]}]
|
||||||
(if (features/active-feature? @st/state "render-wasm/v1")
|
(if (features/active-feature? @st/state "render-wasm/v1")
|
||||||
(let [selrect-transform (mf/deref refs/workspace-selrect)
|
(let [{:keys [width height]} (wasm.api/get-text-dimensions (:id shape))
|
||||||
[{:keys [x y width height]} transform] (dsh/get-selrect selrect-transform shape)]
|
selrect-transform (mf/deref refs/workspace-selrect)
|
||||||
|
[selrect transform] (dsh/get-selrect selrect-transform shape)]
|
||||||
[:rect.main.viewport-selrect
|
[:rect.main.viewport-selrect
|
||||||
{:x x
|
{:x (:x selrect)
|
||||||
:y y
|
:y (:y selrect)
|
||||||
:width width
|
:width (max width (:width selrect))
|
||||||
:height height
|
:height (max height (:height selrect))
|
||||||
:transform transform
|
:transform transform
|
||||||
:style {:stroke "var(--color-accent-tertiary)"
|
:style {:stroke "var(--color-accent-tertiary)"
|
||||||
:stroke-width (/ 1 zoom)
|
:stroke-width (/ 1 zoom)
|
||||||
|
|||||||
@ -257,7 +257,7 @@
|
|||||||
(filter (if clip-children?
|
(filter (if clip-children?
|
||||||
(comp overlaps-parent? :clip-parents)
|
(comp overlaps-parent? :clip-parents)
|
||||||
(constantly true)))
|
(constantly true)))
|
||||||
(map :id))
|
(keep :id))
|
||||||
result)))
|
result)))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user