Merge pull request #5824 from penpot/alotor-propagate-modifiers

 Use skia matrix for internal data
This commit is contained in:
Alejandro 2025-02-13 10:21:58 +01:00 committed by GitHub
commit 773b4fe02e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 228 additions and 211 deletions

View file

@ -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)

View file

@ -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))

View file

@ -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)