0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 10:38:13 -05:00

Minor changes on text tool.

This commit is contained in:
Andrey Antukh 2017-01-11 20:51:46 +01:00
parent c95a4050f4
commit da9bebf95c
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -149,22 +149,31 @@
own))
(mx/defc text-shape-wrapper
{:mixins [mx/static]
{
:did-mount text-shape-wrapper-did-mount
:did-remount text-shape-wrapper-did-remount}
[{:keys [id tmp-resize-xform tmp-displacement] :as shape}]
[{:keys [id tmp-resize-xform tmp-displacement drawing?] :as shape}]
(println "text-shape-wrapper" shape)
(let [xfmt (cond-> (gmt/matrix)
tmp-displacement (gmt/translate tmp-displacement)
tmp-resize-xform (gmt/multiply tmp-resize-xform))
{:keys [x1 y1 width height] :as shape} (-> (geom/transform shape xfmt)
(geom/size))]
[:foreignObject {:x x1
:y y1
:id (str id)
:ref "fobject"
:width width
:height height}]))
(geom/size))
attrs {:x x1
:y y1
:id (str id)
:ref "fobject"
:width width
:height height}
props (merge attrs
(when drawing?
{:style {:stroke "#333"
:stroke-width "0.5"
:stroke-opacity "0.5"
:fill "transparent"}}))]
[:foreignObject props]))
;; --- Text Shape Html