mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 04:16:11 +02:00
Allow text selection on view app.
This commit is contained in:
parent
05b6c25aa9
commit
ba40b99c97
2 changed files with 14 additions and 4 deletions
|
@ -70,16 +70,18 @@
|
||||||
font-size
|
font-size
|
||||||
text-align
|
text-align
|
||||||
line-height
|
line-height
|
||||||
letter-spacing]
|
letter-spacing
|
||||||
|
user-select]
|
||||||
:or {fill-color "#000000"
|
:or {fill-color "#000000"
|
||||||
fill-opacity 1
|
fill-opacity 1
|
||||||
font-family "sourcesanspro"
|
font-family "sourcesanspro"
|
||||||
font-weight "normal"
|
font-weight "normal"
|
||||||
font-style "normal"
|
font-style "normal"
|
||||||
fobt-size 16
|
font-size 18
|
||||||
line-height 1.4
|
line-height 1.4
|
||||||
letter-spacing 1
|
letter-spacing 1
|
||||||
text-align "left"}
|
text-align "left"
|
||||||
|
user-select false}
|
||||||
:as shape}]
|
:as shape}]
|
||||||
(let [color (-> fill-color
|
(let [color (-> fill-color
|
||||||
(color/hex->rgba fill-opacity)
|
(color/hex->rgba fill-opacity)
|
||||||
|
@ -92,6 +94,7 @@
|
||||||
:fontFamily font-family
|
:fontFamily font-family
|
||||||
:fontWeight font-weight
|
:fontWeight font-weight
|
||||||
:fontStyle font-style}
|
:fontStyle font-style}
|
||||||
|
(when user-select {:userSelect "auto"})
|
||||||
(when line-height {:lineHeight line-height})
|
(when line-height {:lineHeight line-height})
|
||||||
(when letter-spacing {:letterSpacing letter-spacing}))))
|
(when letter-spacing {:letterSpacing letter-spacing}))))
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,13 @@
|
||||||
(when-let [image (mx/react (image-ref image))]
|
(when-let [image (mx/react (image-ref image))]
|
||||||
(image-shape (assoc item :image image))))
|
(image-shape (assoc item :image image))))
|
||||||
|
|
||||||
|
;; --- Text Shape Wrapper
|
||||||
|
|
||||||
|
(mx/defc text-shape-wrapper
|
||||||
|
{:mixins [mx/static]}
|
||||||
|
[item]
|
||||||
|
(text-shape (assoc item :user-select true)))
|
||||||
|
|
||||||
;; --- Shapes
|
;; --- Shapes
|
||||||
|
|
||||||
(declare shape)
|
(declare shape)
|
||||||
|
@ -93,7 +100,7 @@
|
||||||
(case type
|
(case type
|
||||||
:group (group-shape item shape)
|
:group (group-shape item shape)
|
||||||
:image (image-shape-wrapper item)
|
:image (image-shape-wrapper item)
|
||||||
:text (text-shape item)
|
:text (text-shape-wrapper item)
|
||||||
:icon (icon-shape item)
|
:icon (icon-shape item)
|
||||||
:rect (rect-shape item)
|
:rect (rect-shape item)
|
||||||
:path (path-shape item)
|
:path (path-shape item)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue