mirror of
https://github.com/penpot/penpot.git
synced 2025-05-14 20:46:37 +02:00
✨ Use skia matrix for internal data
This commit is contained in:
parent
4594c7bf0a
commit
3dcabc9502
13 changed files with 228 additions and 211 deletions
|
@ -297,11 +297,15 @@
|
|||
(->> resize-events-stream
|
||||
(rx/take-until stopper)
|
||||
(rx/last)
|
||||
(rx/map #(dwm/set-modifiers (dwm/create-modif-tree ids %) (contains? layout :scale-text))))
|
||||
(rx/map #(dwm/apply-modifiers {:modifiers (dwm/create-modif-tree ids %)
|
||||
:ignore-constraints (contains? layout :scale-text)})))
|
||||
(rx/empty)))
|
||||
|
||||
(rx/of (dwm/apply-modifiers)
|
||||
(finish-transform))))))))
|
||||
(rx/of
|
||||
(if (features/active-feature? state "render-wasm/v1")
|
||||
(dwm/clear-local-transform)
|
||||
(dwm/apply-modifiers))
|
||||
(finish-transform))))))))
|
||||
|
||||
(defn trigger-bounding-box-cloaking
|
||||
"Trigger the bounding box cloaking (with default timer of 1sec)
|
||||
|
|
|
@ -249,7 +249,7 @@
|
|||
offset (:offset stop)]
|
||||
[r g b a (* 100 offset)]))
|
||||
stops)))))
|
||||
(h/call internal-module "_add_shape_fill_stops" stops-ptr n-stops))
|
||||
(h/call internal-module "_add_shape_fill_stops"))
|
||||
|
||||
(some? image)
|
||||
(let [id (dm/get-prop image :id)
|
||||
|
@ -423,6 +423,34 @@
|
|||
[opacity]
|
||||
(h/call internal-module "_set_shape_opacity" (or opacity 1)))
|
||||
|
||||
(defn- translate-constraint-h
|
||||
[type]
|
||||
(case type
|
||||
:left 0
|
||||
:right 1
|
||||
:leftright 2
|
||||
:center 3
|
||||
:scale 4))
|
||||
|
||||
(defn set-constraints-h
|
||||
[constraint]
|
||||
(when constraint
|
||||
(h/call internal-module "_set_shape_constraint_h" (translate-constraint-h constraint))))
|
||||
|
||||
(defn- translate-constraint-v
|
||||
[type]
|
||||
(case type
|
||||
:top 0
|
||||
:bottom 1
|
||||
:topbottom 2
|
||||
:center 3
|
||||
:scale 4))
|
||||
|
||||
(defn set-constraints-v
|
||||
[constraint]
|
||||
(when constraint
|
||||
(h/call internal-module "_set_shape_constraint_v" (translate-constraint-v constraint))))
|
||||
|
||||
(defn set-shape-hidden
|
||||
[hidden]
|
||||
(h/call internal-module "_set_shape_hidden" hidden))
|
||||
|
|
|
@ -129,6 +129,8 @@
|
|||
:blur (api/set-shape-blur v)
|
||||
:svg-attrs (when (= (:type self) :path)
|
||||
(api/set-shape-path-attrs v))
|
||||
:constraints-h (api/set-constraints-h v)
|
||||
:constraints-v (api/set-constraints-v v)
|
||||
:content (cond
|
||||
(= (:type self) :path)
|
||||
(api/set-shape-path-content v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue