🐛 Fixes problems with handoff and text shapes

This commit is contained in:
alonso.torres 2020-12-23 10:44:04 +01:00
parent 33b6df01ba
commit 9ae9da8256
2 changed files with 7 additions and 6 deletions

View file

@ -88,7 +88,7 @@
[props ref] [props ref]
(let [shape (unchecked-get props "shape") (let [shape (unchecked-get props "shape")
selected? (unchecked-get props "selected?") selected? (unchecked-get props "selected?")
grow-type (:grow-type shape) grow-type (unchecked-get props "grow-type")
{:keys [id x y width height content]} shape] {:keys [id x y width height content]} shape]
[:foreignObject {:x x [:foreignObject {:x x
:y y :y y
@ -97,7 +97,6 @@
:transform (geom/transform-matrix shape) :transform (geom/transform-matrix shape)
:width (if (#{:auto-width} grow-type) 10000 width) :width (if (#{:auto-width} grow-type) 10000 width)
:height (if (#{:auto-height :auto-width} grow-type) 10000 height) :height (if (#{:auto-height :auto-width} grow-type) 10000 height)
:ref ref :ref ref}
:pointer-events "none"}
[:& text-content {:shape shape [:& text-content {:shape shape
:content (:content shape)}]])) :content (:content shape)}]]))

View file

@ -110,10 +110,12 @@
[:& text/text-shape {:key (str "text-shape" (:id shape)) [:& text/text-shape {:key (str "text-shape" (:id shape))
:ref text-ref-cb :ref text-ref-cb
:shape shape :shape shape
:selected? selected?}]] :selected? selected?
:grow-type (:grow-type shape)}]]
(when edition? (when edition?
[:g {:pointer-events "none"}
[:& editor/text-shape-edit {:key (str "editor" (:id shape)) [:& editor/text-shape-edit {:key (str "editor" (:id shape))
:shape shape}]) :shape shape}]])
(when-not edition? (when-not edition?
[:rect.text-actions [:rect.text-actions